-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from marquiz/devel/release-helper
Add a helper script for preparing the release
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash -e | ||
set -o pipefail | ||
|
||
this=`basename $0` | ||
|
||
usage () { | ||
cat << EOF | ||
Usage: $this VERSION | ||
Example: | ||
$this v0.2.0 | ||
EOF | ||
} | ||
|
||
# Check args | ||
if [ $# -ne 1 ]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
version=$1 | ||
shift 1 | ||
|
||
if ! [[ $version =~ ^v[0-9]+\.[0-9]+\..+$ ]]; then | ||
echo -e "ERROR: invalid VERSION '$version'" | ||
exit 1 | ||
fi | ||
|
||
# Patch Kustomize | ||
echo "Patching kustomize files" | ||
find deployment/base deployment/overlays -name '*.yaml' | xargs -I '{}' \ | ||
sed -E -e s",newTag:.+$,newTag: $version," \ | ||
-e s",imagePullPolicy:.+$,imagePullPolicy: IfNotPresent," \ | ||
-i '{}' | ||
|
||
# Patch Helm charts | ||
echo "Patching Helm charts" | ||
find deployment/helm -name Chart.yaml | xargs -I '{}' \ | ||
sed -e s"/appVersion:.*/appVersion: $version/" -i '{}' | ||
find deployment/helm -name values.yaml | xargs -I '{}' \ | ||
sed -e s"/pullPolicy:.*/pullPolicy: IfNotPresent/" -i '{}' | ||
|