Skip to content

Commit fe5a3b8

Browse files
committed
feat: add support for additional values passed in env
1 parent 5906ab0 commit fe5a3b8

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

argocd-helmfile

+17-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
# ARGOCD_APP_SOURCE_PATH - the path of the app within the repo
99
# ARGOCD_APP_SOURCE_REPO_URL the repo's URL
1010
# ARGOCD_APP_SOURCE_TARGET_REVISION - the target revision from the spec, e.g. master.
11-
12-
# does not have "v" in front
1311
# KUBE_VERSION="<major>.<minor>"
1412
# KUBE_API_VERSIONS="v1,apps/v1,..."
1513

1614
set -e
1715
set -x
1816

17+
cleanup() {
18+
if [[ "${ARGOCD_ENV_ADDITIONAL_VALUES}" ]] ; then
19+
rm -r $tmpfile
20+
fi
21+
}
22+
23+
trap "cleanup" ERR
24+
1925
echoerr() { printf "%s\n" "$*" >&2; }
2026

2127
# exit immediately if no phase is passed in
@@ -85,11 +91,20 @@ case $phase in
8591
HELM_VALUES_FILE="--values ${file} ${HELM_VALUES_FILE}"
8692
done
8793

94+
if [[ "${ARGOCD_ENV_ADDITIONAL_VALUES}" ]] ; then
95+
echoerr "Detected additional values"
96+
tmpfile=$(mktemp /tmp/helmfile-additional-values-XXXXXX)
97+
echo "${ARGOCD_ENV_ADDITIONAL_VALUES}" > $tmpfile
98+
HELM_VALUES_FILE="--values ${tmpfile} ${HELM_VALUES_FILE}"
99+
fi
100+
88101
${helmfile} \
89102
template \
90103
--skip-deps \
91104
--args "${INTERNAL_HELM_TEMPLATE_OPTIONS}" \
92105
${HELM_VALUES_FILE}
106+
107+
cleanup
93108
;;
94109

95110
*)

0 commit comments

Comments
 (0)