-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add utility script for helm bake
- Loading branch information
Showing
2 changed files
with
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
swingletree-bake.yml |
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 | ||
|
||
TEMP=`getopt -o vdm: --long gh-appid:,gh-keyfile: -- "$@"` | ||
|
||
if [ $? != 0 ] ; then echo "missing arguments. terminating..." >&2 ; exit 1 ; fi | ||
|
||
# Note the quotes around `$TEMP': they are essential! | ||
eval set -- "$TEMP" | ||
|
||
GITHUB_KEYFILE= | ||
GITHUB_APPID= | ||
|
||
TARGET=swingletree-bake.yml | ||
|
||
while true; do | ||
case "$1" in | ||
--gh-keyfile ) GITHUB_KEYFILE="$2"; shift 2 ;; | ||
--gh-appid ) GITHUB_APPID="$2"; shift 2 ;; | ||
-- ) shift; break ;; | ||
* ) break ;; | ||
esac | ||
done | ||
|
||
if [ -z $GITHUB_APPID ]; then | ||
echo " ! option --gh-appid is missing" | ||
exit 1 | ||
fi | ||
|
||
if [ -z $GITHUB_KEYFILE ]; then | ||
echo " ! option --gh-keyfile is missing" | ||
exit 1 | ||
fi | ||
|
||
if [ -e $GITHUB_KEYFILE ]; then | ||
echo " > baking your manifest into $TARGET" | ||
helm template swingletree \ | ||
--set swingletree.scotty.github.app.id=$GITHUB_APPID \ | ||
--set-file github_app_key=$GITHUB_KEYFILE \ | ||
> $TARGET | ||
else | ||
echo " ! $GITHUB_KEYFILE does not exist" | ||
exit 1 | ||
fi |