github.com/argoproj/argo-cd@v1.8.7/hack/update-manifests.sh (about)

     1  #! /usr/bin/env bash
     2  set -x
     3  set -o errexit
     4  set -o nounset
     5  set -o pipefail
     6  
     7  KUSTOMIZE=kustomize
     8  
     9  SRCROOT="$( CDPATH='' cd -- "$(dirname "$0")/.." && pwd -P )"
    10  AUTOGENMSG="# This is an auto-generated file. DO NOT EDIT"
    11  
    12  cd ${SRCROOT}/manifests/ha/base/redis-ha && ./generate.sh
    13  
    14  IMAGE_NAMESPACE="${IMAGE_NAMESPACE:-argoproj}"
    15  IMAGE_TAG="${IMAGE_TAG:-}"
    16  
    17  # if the tag has not been declared, and we are on a release branch, use the VERSION file.
    18  if [ "$IMAGE_TAG" = "" ]; then
    19    branch=$(git rev-parse --abbrev-ref HEAD)
    20    if [[ $branch = release-* ]]; then
    21      pwd
    22      IMAGE_TAG=v$(cat $SRCROOT/VERSION)
    23    fi
    24  fi
    25  # otherwise, use latest
    26  if [ "$IMAGE_TAG" = "" ]; then
    27    IMAGE_TAG=latest
    28  fi
    29  
    30  $KUSTOMIZE version
    31  
    32  cd ${SRCROOT}/manifests/base && $KUSTOMIZE edit set image argoproj/argocd=${IMAGE_NAMESPACE}/argocd:${IMAGE_TAG}
    33  cd ${SRCROOT}/manifests/ha/base && $KUSTOMIZE edit set image argoproj/argocd=${IMAGE_NAMESPACE}/argocd:${IMAGE_TAG}
    34  
    35  echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/install.yaml"
    36  $KUSTOMIZE build "${SRCROOT}/manifests/cluster-install" >> "${SRCROOT}/manifests/install.yaml"
    37  
    38  echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/namespace-install.yaml"
    39  $KUSTOMIZE build "${SRCROOT}/manifests/namespace-install" >> "${SRCROOT}/manifests/namespace-install.yaml"
    40  
    41  echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/ha/install.yaml"
    42  $KUSTOMIZE build "${SRCROOT}/manifests/ha/cluster-install" >> "${SRCROOT}/manifests/ha/install.yaml"
    43  
    44  echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/ha/namespace-install.yaml"
    45  $KUSTOMIZE build "${SRCROOT}/manifests/ha/namespace-install" >> "${SRCROOT}/manifests/ha/namespace-install.yaml"
    46