summaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authorjannfis <jann@mistrust.net>2020-08-04 19:45:46 +0200
committerjannfis <jann@mistrust.net>2020-08-04 19:45:46 +0200
commitbb184543e516f17c5801242645b5d77d0244c538 (patch)
tree79913d38a3f4566a4547d0923452a625518437c3 /hack
Initial commit
Diffstat (limited to 'hack')
-rwxr-xr-xhack/generate-manifests.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/hack/generate-manifests.sh b/hack/generate-manifests.sh
new file mode 100755
index 0000000..27286d5
--- /dev/null
+++ b/hack/generate-manifests.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -eo pipefail
+set -x
+
+SRCROOT="$( CDPATH='' cd -- "$(dirname "$0")/.." && pwd -P )"
+KUSTOMIZE="kustomize"
+TEMPFILE=$(mktemp /tmp/aic-manifests.XXXXXX)
+
+IMAGE_NAMESPACE="${IMAGE_NAMESPACE:-argoproj-labs}"
+IMAGE_TAG="${IMAGE_TAG:-}"
+
+# if the tag has not been declared, and we are on a release branch, use the VERSION file.
+if [ "$IMAGE_TAG" = "" ]; then
+ branch=$(git rev-parse --abbrev-ref HEAD || true)
+ if [[ $branch = release-* ]]; then
+ pwd
+ IMAGE_TAG=v$(cat $SRCROOT/VERSION)
+ fi
+fi
+# otherwise, use latest
+if [ "$IMAGE_TAG" = "" ]; then
+ IMAGE_TAG=latest
+fi
+
+cd ${SRCROOT}/manifests/base && kustomize edit set image argoproj-labs/argocd-image-updater=${IMAGE_NAMESPACE}/argocd-image-updater:${IMAGE_TAG}
+cd ${SRCROOT}/manifests/base && ${KUSTOMIZE} build . > ${TEMPFILE}
+
+mv ${TEMPFILE} ${SRCROOT}/manifests/install.yaml
+cd ${SRCROOT} && chmod 644 manifests/install.yaml