Skip to content

Commit

Permalink
Add support for value files
Browse files Browse the repository at this point in the history
Separate the files by comma.
  • Loading branch information
olereidar committed Sep 2, 2019
1 parent 4dbcfb1 commit 0c16974
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/commands/install-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ parameters:
Examples: dev, staging, production, kafka
type: string
default: ""
value-files:
description: |
Specify values in a YAML file or a URL (can specify multiple).
Separated by comma ( , )
(e.g. helm/some-values.yaml, helm/other-values.yaml)
type: string
default: ""
wait:
description: |
Whether to wait for the installation to be complete. Default true
Expand Down Expand Up @@ -56,12 +63,19 @@ steps:
name: Deploy Helm chart to Kubernetes
command: |
NAMESPACE="<< parameters.namespace >>"
VALUE_FILES="<< parameters.value-files >>"
WAIT="<< parameters.wait >>"
if [ -n "${NAMESPACE}" ]; then
if [[ -n "${NAMESPACE}" ]]; then
set -- "$@" --namespace="${NAMESPACE}"
set -- "$@" --set environment="${NAMESPACE}"
fi
if [ "${WAIT}" == "true" ]; then
if [[ -n "${VALUE_FILES}" ]]; then
SPLIT_VALUE_FILES=($(echo ${VALUE_FILES} | tr "," "\n"))
for i in ${SPLIT_VALUE_FILES[@]} ; do
set -- "$@" -f "${i}"
done
fi
if [[ "${WAIT}" == "true" ]]; then
set -- "$@" --wait
fi
helm upgrade --install << parameters.release-name >> << parameters.chart >> "$@"

0 comments on commit 0c16974

Please sign in to comment.