Skip to content

Commit

Permalink
Merge pull request zendesk#22 from novas0x2a/master
Browse files Browse the repository at this point in the history
Support helm template
  • Loading branch information
szibis authored Jan 3, 2018
2 parents 7df39dd + 4bcb370 commit f81cc0a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

set -ueo pipefail

# Redirect fds so that output to &3 is real stdout, and &1 goes to stderr
# instead; this prevents accidentially intermixing with what helm sends to
# stdout.
exec 3>&1
exec 1>&2

# colors
RED='\033[0;31m'
#GREEN='\033[0;32m'
Expand Down Expand Up @@ -70,7 +76,7 @@ decrypt_helm_vars() {

function cleanup {
case "${CURRENT_COMMAND}" in
install|upgrade|rollback)
install|upgrade|rollback|template)
echo -e "${YELLOW}>>>>>>${NOC} ${BLUE}Cleanup${NOC}"
for file in "${@}";
do
Expand All @@ -84,7 +90,7 @@ function cleanup {

function helm_cmd {
echo ""
$(echo "${HELM_CMD} $*" | sed -e 's/secrets.yaml/secrets.yaml.dec/g')
$(echo "${HELM_CMD} $*" | sed -e 's/secrets.yaml/secrets.yaml.dec/g') >&3
local status=$?
if [ "$status" -ne 0 ]; then
echo ""
Expand All @@ -98,7 +104,7 @@ function helm_cmd {
}

case "${CURRENT_COMMAND}" in
install|upgrade|rollback)
install|upgrade|rollback|template)
for file in "$@"
do
decrypt_helm_vars "$file"
Expand Down

0 comments on commit f81cc0a

Please sign in to comment.