forked from external-secrets/kubernetes-external-secrets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·34 lines (28 loc) · 1.55 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
set -e
if [ -z "$ALLOW_DIRTY" ]; then
if ! output=$(git status --porcelain) || ! [ -z "$output" ]; then
git status
echo ""
echo "Ensure working directory is clean before releasing."
echo ""
exit 1
fi
fi
SHA=$(git rev-parse --short HEAD)
TAG=$(git describe)
perl -i -pe "s/kubernetes-external-secrets Image tag \| \`[a-zA-Z0-9\.]*/kubernetes-external-secrets Image tag \| \`$TAG/" charts/kubernetes-external-secrets/README.md
perl -i -pe "s/tag: [a-zA-Z0-9\.]*/tag: $TAG/" charts/kubernetes-external-secrets/values.yaml
perl -i -pe "s/appVersion: [a-zA-Z0-9\.]*/appVersion: $TAG/" charts/kubernetes-external-secrets/Chart.yaml
perl -i -pe "s/version: [a-zA-Z0-9\.]*/version: $TAG/" charts/kubernetes-external-secrets/Chart.yaml
(cd charts/kubernetes-external-secrets && helm package . && helm repo index --merge ../../docs/index.yaml ./ && mv *.tgz ../../docs && mv index.yaml ../../docs)
docker build -t godaddy/kubernetes-external-secrets:$SHA .
docker tag godaddy/kubernetes-external-secrets:$SHA godaddy/kubernetes-external-secrets:$TAG
docker tag godaddy/kubernetes-external-secrets:$SHA godaddy/kubernetes-external-secrets:latest
echo ""
echo "Do the following to publish:"
echo ""
echo " 1. inspect local changes (e.g., git status, git diff)"
echo " 2. git add --all && git commit -m \"chore(release): godaddy/kubernetes-external-secrets:$TAG\""
echo " 3. git push --follow-tags origin master && docker push godaddy/kubernetes-external-secrets:$TAG && docker push godaddy/kubernetes-external-secrets:latest"
echo ""