Skip to content

Commit 97b1a23

Browse files
authored
Ahs extra values (#22)
* Support values input to action that is passed to helm (deploy only) * -z -n * helmfile, not helm. Use --state-values-set instead of --set * in more spots * debug * try a file * try a values file * sub file -> yaml * fix superfluous flag arg * cleanup * revert formatting changes * fix whitespace * Echo extra values for visibility * Revert accidental formatting changes * Choose option 2: use a yaml file
1 parent 398cfbc commit 97b1a23

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ inputs:
4949
description: The name of the label used to describe the helm release
5050
default: "release"
5151
required: false
52+
values_yaml:
53+
description: YAML string with extra values to use in a helmfile deploy
54+
required: false
5255
outputs:
5356
webapp-url:
5457
description: "Web Application url"
@@ -58,6 +61,7 @@ runs:
5861
env:
5962
AWS_REGION: ${{ inputs.aws-region }}
6063
ENVIRONMENT: ${{ inputs.environment }}
64+
HELM_VALUES_YAML: ${{ inputs.values_yaml }}
6165
HELMFILE: ${{ inputs.helmfile }}
6266
HELMFILE_PATH: ${{ inputs.helmfile-path }}
6367
NAMESPACE: ${{ inputs.namespace }}

entrypoint.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
export APPLICATION_HELMFILE=$(pwd)/${HELMFILE_PATH}/${HELMFILE}
66

77
source /etc/profile.d/aws.sh
8-
8+
99
# Used for debugging
1010
aws sts --region ${AWS_REGION} get-caller-identity
1111

@@ -22,8 +22,13 @@ if [[ "${HELM_DEBUG}" == "true" ]]; then
2222
DEBUG_ARGS=" --debug"
2323
fi
2424

25-
if [[ "${OPERATION}" == "deploy" ]]; then
25+
if [[ -n "$HELM_VALUES_YAML" ]]; then
26+
echo -e "Using extra values:\n${HELM_VALUES_YAML}"
27+
export HELM_VALUES_FILE="/tmp/extra_helm_values.yml"
28+
echo "$HELM_VALUES_YAML" > "$HELM_VALUES_FILE"
29+
fi
2630

31+
if [[ "${OPERATION}" == "deploy" ]]; then
2732
OPERATION_COMMAND="helmfile --namespace ${NAMESPACE} --environment ${ENVIRONMENT} --file /deploy/helmfile.yaml $DEBUG_ARGS apply"
2833
echo "Executing: ${OPERATION_COMMAND}"
2934
${OPERATION_COMMAND}
@@ -55,7 +60,5 @@ elif [[ "${OPERATION}" == "destroy" ]]; then
5560
if [[ "${RELEASES_COUNTS}" == "0" ]]; then
5661
kubectl delete ns ${NAMESPACE}
5762
fi
58-
fi
63+
fi
5964
fi
60-
61-

root/deploy/helmfile.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ helmfiles:
1414
- path: {{ requiredEnv "APPLICATION_HELMFILE" }}
1515
values:
1616
- /tmp/platform.yaml
17+
{{- if env "HELM_VALUES_FILE" }}
18+
- {{ env "HELM_VALUES_FILE" }}
19+
{{- end }}

0 commit comments

Comments
 (0)