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