diff --git a/Dockerfile b/Dockerfile index 0cc7c0a..4ff01d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.17 as builder +FROM docker.io/golang:1.19 as builder RUN git clone --branch=20200403-1 --depth=1 https://github.com/camptocamp/helm-sops && \ cd helm-sops && \ go build RUN wget -O /tmp/helmfile https://github.com/roboll/helmfile/releases/download/v0.144.0/helmfile_linux_amd64 && chmod +x /tmp/helmfile RUN wget -O /tmp/yq https://github.com/mikefarah/yq/releases/download/v4.25.1/yq_linux_amd64 && chmod +x /tmp/yq -FROM argoproj/argocd:v2.4.11 +FROM quay.io/argoproj/argocd:v2.6.1 USER root COPY argocd-repo-server-wrapper /usr/local/bin/ COPY argocd-helmfile /usr/local/bin/ @@ -18,5 +18,4 @@ RUN cd /usr/local/bin && \ chmod 755 argocd-repo-server && \ mv helm _helm && \ mv helm-sops helm - USER 999 diff --git a/README.md b/README.md index caabb52..ac17d5d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ To use this custom image when deploying Argo CD using the [Helm chart](https://g global: image: repository: "camptocamp/argocd" - tag: "v2.3.4_c2c.1" + tag: "v2.6.1_c2c.1" ``` #### Using Sops with a GPG key diff --git a/argocd-helmfile b/argocd-helmfile index 0efa051..63aba0f 100755 --- a/argocd-helmfile +++ b/argocd-helmfile @@ -8,13 +8,22 @@ # ARGOCD_APP_SOURCE_PATH - the path of the app within the repo # ARGOCD_APP_SOURCE_REPO_URL the repo's URL # ARGOCD_APP_SOURCE_TARGET_REVISION - the target revision from the spec, e.g. master. - -# does not have "v" in front # KUBE_VERSION="." # KUBE_API_VERSIONS="v1,apps/v1,..." set -e -set -x + +if [ "${ARGOCD_CMP_HELMFILE_DEBUG}" == "true" ] ; then + set -x +fi + +cleanup() { + if [[ "${ARGOCD_ENV_ADDITIONAL_VALUES}" ]] ; then + rm -r $tmpfile + fi +} + +trap "cleanup" ERR echoerr() { printf "%s\n" "$*" >&2; } @@ -85,11 +94,20 @@ case $phase in HELM_VALUES_FILE="--values ${file} ${HELM_VALUES_FILE}" done + if [[ "${ARGOCD_ENV_ADDITIONAL_VALUES}" ]] ; then + echoerr "Detected additional values" + tmpfile=$(mktemp /tmp/helmfile-additional-values-XXXXXX) + echo "${ARGOCD_ENV_ADDITIONAL_VALUES}" > $tmpfile + HELM_VALUES_FILE="--values ${tmpfile} ${HELM_VALUES_FILE}" + fi + ${helmfile} \ template \ --skip-deps \ --args "${INTERNAL_HELM_TEMPLATE_OPTIONS}" \ ${HELM_VALUES_FILE} + + cleanup ;; *)