A newer version of Hazelcast CLC is available.

View latest

clc project (Beta)

Project commands are a group of project operations.

Usage:

clc project [command] [flags]

clc project create

Creates a project from the given template.

Usage:

clc project create [template-name] [placeholder-values] [flags]

Parameters:

Parameter Required Description Default

--output-dir, -o

Optional

Output directory for the project to be created.

Template name

--source

Optional

The Github organization/user account to search for the templates.

hazelcast-templates

template-name

Required

Name of the template.

placeholder-values

Optional

Template placeholder values can be specified as key-value pairs. You can use lowercase letters, numbers and the underscore character in keys. Example: my_key1=value

Creating and Using Your Own Templates

Templates are located in https://github.com/hazelcast-templates. You can override it by using the --source flag.

  • Templates are in Go template format.

  • You can create a "defaults.yaml" file for default values in template’s root directory.

  • Template files must have the ".template" extension.

  • Files with "." and "_" prefixes are ignored unless they have the ".keep" extension.

  • All files with ".keep" extension are copied by stripping the ".keep" extension.

  • Other files are copied verbatim. *Properties are read from the following resources in order:

    1. defaults.yaml (keys cannot contain punctuation)

    2. config.yaml

    3. User passed key-values in the "KEY=VALUE" format. The keys can only contain lowercase letters, numbers and the underscore character.

Placeholders

You can use the placeholders in "defaults.yaml" and the following configuration item placeholders:

  • clc_home

  • cluster_name

  • cluster_address

  • cluster_user

  • cluster_password

  • cluster_discovery_token

  • ssl_enabled

  • ssl_server

  • ssl_skip_verify

  • ssl_ca_path

  • ssl_key_path

  • ssl_key_password

  • log_path

  • log_level

Actions

  • repeat COUNT: Returns an integer array with number from 0 to COUNT. If COUNT is 0, an array with 0 integers are returned.

    Template:

    {{ range repeat 3 }}
    Number {{.}}
    {{ end -}}

    Output:

    Number 0
    Number 1
    Number 2
  • each VALUE …​: Returns an array with items having the Index and Value.

    Template:

    {{ range each "foo" "bar" 38 }}
    Item {{ .Index }} = {{ .Value }}
    {{ end -}}

    Output:

    Item 0 = foo
    Item 1 = bar
    Item 2 = 38

Usage

Example (Linux and macOS):

clc project create \
simple-streaming-pipeline\
--output-dir my-project\
my_key1=my_value1 my_key2=my_value2

Example (Windows):

clc project create^
simple-streaming-pipeline^
--output-dir my-project^
my_key1=my_value1 my_key2=my_value2