add if..else to .sh and change env var for version
#!/bin/bash
+
+#modify Chart.yaml based on whether workflow was triggered by a new tag or a file update in ./deploy/helm
+if [[ ${GITHUB_REF##*/} == "v"* ]]; then
+ sed -i -e "s/^appVersion:.*/appVersion: ${GITHUB_REF##*/}/" ./resultsFiles/envOutput.yaml
+ sed -i -e "s/^version:.*/version: $GITHUB_RUN_NUMBER/" ./resultsFiles/envOutput.yaml
+else
+ sed -i -e "s/^version:.*/version: $GITHUB_RUN_NUMBER/" ./resultsFiles/envOutput.yaml
+fi
+
# the github action we use has helm 3 (required) as 'helmv3' in its path, so we alias that in and use it if present
HELM="helm"
if which helmv3; then
@@ -14,15 +23,11 @@ if [ "$?" -ne "0" ]; then
exit 1
fi
-$HELM package --app-version ${GITHUB_REF##*/} --version $GITHUB_RUN_ID -d ../../helm-repos/tmp.d ./kuberhealthy
-# old package structure which modified generated dates in index.yaml on existing package descriptions
-#$HELM package --app-version ${GITHUB_REF##*/} --version $GITHUB_RUN_ID -d ../../helm-repos/archives ./kuberhealthy
+$HELM package --app-version ${GITHUB_REF##*/} --version $GITHUB_RUN_NUMBER -d ../../helm-repos/tmp.d ./kuberhealthy
cd ../../helm-repos
$HELM repo index ./tmp.d --merge ./index.yaml --url https://comcast.github.io/kuberhealthy/helm-repos/archives
-# Old indexing line below...
-#$HELM repo index ./archives --merge ./index.yaml --url https://comcast.github.io/kuberhealthy/helm-repos/archives
-mv -f ./tmp.d/kuberhealthy-${GITHUB_RUN_ID}.tgz ./archives
+mv -f ./tmp.d/kuberhealthy-$GITHUB_RUN_NUMBER.tgz ./archives
mv -f ./tmp.d/index.yaml ./
