argocd-example-apps
argocd-example-apps copied to clipboard
Add Git tags for recent versions of all Helm/Kustomize apps
In order to demonstrate how you could pin an ArgoCD app to a specific version when using Git (e.g. by referencing targetRevision: charts/helm-guestbook/0.1.0 instead of HEAD), it would make sense that his repository contains Git tags for recent versions of all Helm/Kustomize app.
Snippet to add Git tags for latest version changes to Helm charts:
COMMIT=$(git log -n 1 --pretty=format:%H -- "$CHART_DIR/Chart.yaml")
VERSION=$(awk '/^version: *(.+)$/ { print $2; }' "$CHART_DIR/Chart.yaml")
TAG="charts/$CHART_NAME/$VERSION"
git tag -f "$TAG" "$COMMIT"
git push --tags