Skip to content

Commit

Permalink
chore: add utility script for helm bake
Browse files Browse the repository at this point in the history
  • Loading branch information
error418 committed Nov 16, 2019
1 parent 316d32d commit e4ba5fe
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
swingletree-bake.yml
43 changes: 43 additions & 0 deletions helm/bake.sh
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

0 comments on commit e4ba5fe

Please sign in to comment.