@@ -7,6 +7,7 @@ includes:
77vars :
88 # Application configuration
99 APP_SLUG : ' {{.REPLICATED_APP | default "wg-easy"}}'
10+ MAIN_CHART : wg-easy
1011
1112 # Cluster configuration
1213 CLUSTER_NAME : ' {{.CLUSTER_NAME | default "test-cluster"}}'
@@ -231,6 +232,9 @@ tasks:
231232 - yq ea '[.spec.namespace] | unique' */replicated/helmChart-*.yaml | yq '.spec.additionalNamespaces *= load("/dev/stdin") | .spec.additionalNamespaces += "*" ' replicated/application.yaml > release/application.yaml.new
232233 - mv release/application.yaml.new release/application.yaml
233234
235+ # set version from main chart
236+ - yq '.spec.chart.chartVersion' "./release/helmChart-{{.MAIN_CHART}}.yaml" > ./release/version
237+
234238 # set helmChart versions from associated helm Chart.yaml
235239 - echo "Setting helmChart versions..."
236240 - |
@@ -287,14 +291,15 @@ tasks:
287291 CHANNEL : ' {{.CHANNEL | default "Unstable"}}'
288292 RELEASE_NOTES : ' {{.RELEASE_NOTES | default "Release created via task release-create"}}'
289293 requires :
290- vars : [APP_SLUG, VERSION ]
294+ vars : [APP_SLUG]
291295 cmds :
292296 - echo "Creating and promoting release for {{.APP_SLUG}} to channel {{.CHANNEL}}..."
293297 - |
294298 # Create and promote the release in one step
295299 echo "Creating release from files in ./release directory..."
296- replicated release create --app {{.APP_SLUG}} --yaml-dir ./release --release-notes "{{.RELEASE_NOTES}}" --promote {{.CHANNEL}} --version {{.VERSION}}
297- echo "Release version {{.VERSION}} created and promoted to channel {{.CHANNEL}}"
300+ VERSION=$(cat ./release/version)
301+ replicated release create --app {{.APP_SLUG}} --yaml-dir ./release --release-notes "{{.RELEASE_NOTES}}" --promote {{.CHANNEL}} --version "$VERSION"
302+ echo "Release version $VERSION created and promoted to channel {{.CHANNEL}}"
298303 deps :
299304 - release-prepare
300305
0 commit comments