diff --git a/charts/argo-cd/hack/update_crds.sh b/charts/argo-cd/hack/update_crds.sh new file mode 100755 index 00000000..d2243806 --- /dev/null +++ b/charts/argo-cd/hack/update_crds.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [[ $(uname -s) = "Darwin" ]]; then + VERSION="$(grep ^appVersion "${SCRIPT_DIR}/../Chart.yaml" | sed 's/appVersion: //g')" +else + VERSION="$(grep ^appVersion "${SCRIPT_DIR}/../Chart.yaml" | sed 's/appVersion:\s//g')" +fi + +FILES=( + "crd-application.yaml : application-crd.yaml" + "crd-applicationset.yaml : applicationset-crd.yaml" + "crd-project.yaml : appproject-crd.yaml" +) + +for line in "${FILES[@]}"; do + DESTINATION=$(echo "${line%%:*}" | xargs) + SOURCE=$(echo "${line##*:}" | xargs) + + URL="https://raw.githubusercontent.com/argoproj/argo-cd/$VERSION/manifests/crds/$SOURCE" + + echo -e "Downloading Prometheus Operator CRD with Version ${VERSION}:\n${URL}\n" + + echo "# ${URL}" > "${SCRIPT_DIR}/../templates/crds/${DESTINATION}" + + if ! curl --silent --retry-all-errors --fail --location "${URL}" >> "${SCRIPT_DIR}/../templates/crds/${DESTINATION}"; then + echo -e "Failed to download ${URL}!" + exit 1 + fi +done \ No newline at end of file diff --git a/charts/argo-rollouts/hack/update_crds.sh b/charts/argo-rollouts/hack/update_crds.sh new file mode 100755 index 00000000..4ad63acc --- /dev/null +++ b/charts/argo-rollouts/hack/update_crds.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [[ $(uname -s) = "Darwin" ]]; then + VERSION="$(grep ^appVersion "${SCRIPT_DIR}/../Chart.yaml" | sed 's/appVersion: //g')" +else + VERSION="$(grep ^appVersion "${SCRIPT_DIR}/../Chart.yaml" | sed 's/appVersion:\s//g')" +fi + +FILES=( + "analysis-run-crd.yaml : analysis-run-crd.yaml" + "analysis-template-crd.yaml : analysis-template-crd.yaml" + "cluster-analysis-template-crd.yaml : cluster-analysis-template-crd.yaml" + "experiment-crd.yaml : experiment-crd.yaml" + "rollout-crd.yaml : rollout-crd.yaml" +) + +for line in "${FILES[@]}"; do + DESTINATION=$(echo "${line%%:*}" | xargs) + SOURCE=$(echo "${line##*:}" | xargs) + + URL="https://raw.githubusercontent.com/argoproj/argo-rollouts/$VERSION/manifests/crds/$SOURCE" + + echo -e "Downloading Prometheus Operator CRD with Version ${VERSION}:\n${URL}\n" + + echo "# ${URL}" > "${SCRIPT_DIR}/../templates/crds/${DESTINATION}" + + if ! curl --silent --retry-all-errors --fail --location "${URL}" >> "${SCRIPT_DIR}/../templates/crds/${DESTINATION}"; then + echo -e "Failed to download ${URL}!" + exit 1 + fi +done \ No newline at end of file