Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
m-yosefpor committed Feb 9, 2023
2 parents 418ea46 + 32b68da commit c9b5f64
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -18,5 +18,4 @@ RUN cd /usr/local/bin && \
chmod 755 argocd-repo-server && \
mv helm _helm && \
mv helm-sops helm

USER 999
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 21 additions & 3 deletions argocd-helmfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="<major>.<minor>"
# 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; }

Expand Down Expand Up @@ -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
;;

*)
Expand Down

0 comments on commit c9b5f64

Please sign in to comment.