1313 RELEASE_CHANNELd : ' {{.RELEASE_CHANNEL | default "Unstable"}}'
1414 RELEASE_VERSION : ' {{.RELEASE_VERSION | default "0.0.1"}}'
1515 RELEASE_NOTES : ' {{.RELEASE_NOTES | default "Release created via task release-create"}}'
16+ REPLICATED_LICENSE_ID : ' {{.REPLICATED_LICENSE_ID}}'
1617
1718 # Cluster configuration
1819 CLUSTER_NAME : ' {{.CLUSTER_NAME | default "test-cluster"}}'
@@ -54,16 +55,15 @@ tasks:
5455 silent : false
5556 vars :
5657 EMBEDDED : ' {{.EMBEDDED | default "false"}}'
57- LICENSE_ID : ' {{if eq .EMBEDDED "true"}}{{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}{{end}}'
5858 TIMEOUT : ' {{if eq .EMBEDDED "true"}}420{{else}}300{{end}}'
5959 TTL : ' {{.TTL | default "4h"}}'
6060 status :
6161 - replicated cluster ls --output json | jq -e '.[] | select(.name == "{{.CLUSTER_NAME}}")' > /dev/null
6262 cmds :
6363 - |
6464 if [ "{{.EMBEDDED}}" = "true" ]; then
65- echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.LICENSE_ID }}..."
66- replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.LICENSE_ID }} --ttl {{.TTL}}
65+ echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.REPLICATED_LICENSE_ID }}..."
66+ replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.REPLICATED_LICENSE_ID }} --ttl {{.TTL}}
6767 else
6868 echo "Creating cluster {{.CLUSTER_NAME}} with distribution {{.DISTRIBUTION}}..."
6969 replicated cluster create --name {{.CLUSTER_NAME}} --distribution {{.DISTRIBUTION}} --version {{.K8S_VERSION}} --disk {{.DISK_SIZE}} --instance-type {{.INSTANCE_TYPE}} --ttl {{.TTL}}
@@ -174,9 +174,11 @@ tasks:
174174
175175 helm-install :
176176 desc : Install all charts using helmfile
177- silent : false
177+ silent : true
178178 vars :
179- LICENSE_ID : ' {{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}'
179+ HELM_ENV : ' {{.HELM_ENV | default "default"}}'
180+ requires :
181+ vars : [REPLICATED_LICENSE_ID]
180182 cmds :
181183 - echo "Installing all charts via helmfile"
182184 - |
@@ -191,11 +193,8 @@ tasks:
191193 ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}} )
192194
193195 # Deploy with helmfile
194- helm registry logout registry.replicated.com || true
195- helm registry login registry.replicated.com --username [email protected] --password {{.LICENSE_ID}} 196196 echo "Using $ENV_VARS"
197- eval "KUBECONFIG={{.KUBECONFIG_FILE}} HELMFILE_ENVIRONMENT=replicated $ENV_VARS helmfile sync --wait"
198- helm registry logout registry.replicated.com
197+ eval "KUBECONFIG={{.KUBECONFIG_FILE}} HELMFILE_ENVIRONMENT={{.HELM_ENV}} REPLICATED_APP={{.APP_SLUG}} $ENV_VARS helmfile sync --wait"
199198 - echo "All charts installed!"
200199 deps :
201200 - setup-kubeconfig
0 commit comments