Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Argo CD image repo to be configurable #8

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion argocd-install/template-values-override.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
global:
image:
repository: ${QUAY_IMAGE_REPO}/argoproj/argocd
server:
service:
type: NodePort
Expand Down Expand Up @@ -63,7 +66,14 @@ server:
warn: false
metrics:
enabled: true
dex.metrics.enabled: true
dex:
image:
repository: ${GITHUB_IMAGE_REPO}/dexidp/dex
metrics:
enabled: true
redis:
image:
repository: ${DOCKER_IMAGE_REPO}/library/redis
controller.metrics.enabled: true
repoServer.metrics.enabled: true
redis-ha.haproxy.metrics.enabled: false
12 changes: 11 additions & 1 deletion argocd-install/values-override.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
global:
image:
repository: quay.io/argoproj/argocd
server:
service:
type: NodePort
Expand Down Expand Up @@ -63,7 +66,14 @@ server:
warn: false
metrics:
enabled: true
dex.metrics.enabled: true
dex:
image:
repository: ghcr.io/dexidp/dex
metrics:
enabled: true
redis:
image:
repository: docker.io/library/redis
controller.metrics.enabled: true
repoServer.metrics.enabled: true
redis-ha.haproxy.metrics.enabled: false
25 changes: 21 additions & 4 deletions genereate_yamls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ DECAPOD_SITE_NAME="hanu-reference"
DECAPOD_BOOTSTRAP_GIT_REPO_URL="https://github.com/openinfradev/decapod-bootstrap.git"
DECAPOD_MANIFESTS_GIT_REPO_URL="https://github.com/openinfradev/decapod-manifests.git"

DOCKER_IMAGE_REPO="docker.io"
QUAY_IMAGE_REPO="quay.io"
GITHUB_IMAGE_REPO="ghcr.io"

function usage {
echo -e "\nUsage: $0 [--site SITE_NAME] [--bootstrap-git BOOTSTRAP_GIT_URL ] [--manifests-git MANIFESTS_GIT_URL]"
echo -e "\nUsage: $0 [--site SITE_NAME] [--bootstrap-git BOOTSTRAP_GIT_URL ] [--manifests-git MANIFESTS_GIT_URL] [--registry REGISTRY_URL]"
exit 1
}

# We use "$@" instead of $* to preserve argument-boundary information
ARGS=$(getopt -o 's:b:m:h' --long 'site:,bootstrap-git:,manifests-git:,help' -- "$@") || usage
ARGS=$(getopt -o 's:b:m:r:h' --long 'site:,bootstrap-git:,manifests-git:,registry:,help' -- "$@") || usage
eval "set -- $ARGS"

while true; do
Expand All @@ -25,6 +29,10 @@ while true; do
DECAPOD_BOOTSTRAP_GIT_REPO_URL=$2; shift 2;;
(-m|--manifests-git)
DECAPOD_MANIFESTS_GIT_REPO_URL=$2; shift 2;;
(-r|--registry)
DOCKER_IMAGE_REPO=$2
QUAY_IMAGE_REPO=$2
GITHUB_IMAGE_REPO=$2; shift 2;;
(--) shift; break;;
(*) exit 1;; # error
esac
Expand All @@ -33,13 +41,16 @@ done
export DECAPOD_SITE_NAME
export DECAPOD_BOOTSTRAP_GIT_REPO_URL
export DECAPOD_MANIFESTS_GIT_REPO_URL
export DOCKER_IMAGE_REPO
export QUAY_IMAGE_REPO
export GITHUB_IMAGE_REPO

echo "=== Create YAML files using the following Decapod configuration. For help, use the '-h' option"
echo " Site: "$DECAPOD_SITE_NAME
echo " Bootstrap Git: "$DECAPOD_BOOTSTRAP_GIT_REPO_URL
echo " Manifests Git: "$DECAPOD_MANIFESTS_GIT_REPO_URL

DIRS="argocd-install decapod-apps"
DIRS="argocd-install decapod-apps-templates"
for dir in $DIRS
do
if [[ -z $(ls | grep ${dir}) ]]
Expand All @@ -51,8 +62,14 @@ done

for dir in $DIRS
do
if [[ $dir == *"templates" ]]; then
dest_dir=${dir%-templates}
else
dest_dir=$dir
fi

for tpl in $(find ${dir} -name template-* -printf "%f\n")
do
cat $dir/${tpl} | envsubst > ${dir}/${tpl:9}
cat $dir/${tpl} | envsubst > ${dest_dir}/${tpl:9}
done
done