blob: 575225bc7f87ec7aa55bde59d03890dfd9631864 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/usr/bin/env bash
set -eo pipefail
set -x
SRCROOT="$( CDPATH='' cd -- "$(dirname "$0")/.." && pwd -P )"
# Make sure that KUSTOMIZE points to a v2 - we need that to support the kubectl
# integration.
KUSTOMIZE=${KUSTOMIZE:-kustomize}
TEMPFILE=$(mktemp /tmp/aic-manifests.XXXXXX)
IMAGE_NAMESPACE="${IMAGE_NAMESPACE:-argoprojlabs}"
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 ${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
|