Skip to content

Commit

Permalink
Merge pull request #19 from openinfradev/do_not_use_dockerhub
Browse files Browse the repository at this point in the history
Do not use dockerhub
  • Loading branch information
zugwan authored Jun 17, 2024
2 parents a5fdda9 + 8dbcc93 commit 38d538e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 37 deletions.
8 changes: 5 additions & 3 deletions argocd-install/template-values-override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ server:
health_status.status = "Healthy"
health_status.message = "Prometheus is deployed"
return health_status
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_MutatingWebhookConfiguration: |
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_MutatingWebhookConfiguration:
|
jqPathExpressions:
- '.webhooks[]?.clientConfig.caBundle'
- '.webhooks[]?.failurePolicy'
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_ValidatingWebhookConfiguration: |
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_ValidatingWebhookConfiguration:
|
jqPathExpressions:
- '.webhooks[]?.clientConfig.caBundle'
- '.webhooks[]?.failurePolicy'
Expand All @@ -65,7 +67,7 @@ dex:
enabled: true
redis:
image:
repository: ${DOCKER_IMAGE_REPO}/library/redis
repository: ${DOCKER_IMAGE_REPO}/tks/redis
controller:
metrics:
enabled: true
Expand Down
8 changes: 5 additions & 3 deletions argocd-install/values-override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ server:
health_status.status = "Healthy"
health_status.message = "Prometheus is deployed"
return health_status
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_MutatingWebhookConfiguration: |
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_MutatingWebhookConfiguration:
|
jqPathExpressions:
- '.webhooks[]?.clientConfig.caBundle'
- '.webhooks[]?.failurePolicy'
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_ValidatingWebhookConfiguration: |
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_ValidatingWebhookConfiguration:
|
jqPathExpressions:
- '.webhooks[]?.clientConfig.caBundle'
- '.webhooks[]?.failurePolicy'
Expand All @@ -65,7 +67,7 @@ dex:
enabled: true
redis:
image:
repository: docker.io/library/redis
repository: harbor.taco-cat.xyz/tks/redis
controller:
metrics:
enabled: true
Expand Down
73 changes: 42 additions & 31 deletions generate_yamls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,55 @@ DECAPOD_SITE_NAME="decapod-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"
DOCKER_IMAGE_REPO="harbor.taco-cat.xyz"
QUAY_IMAGE_REPO="quay.io"
GITHUB_IMAGE_REPO="ghcr.io"

GIT_REVISION="main"

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

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

while true; do
case $1 in
(-h|--help)
usage; shift 2;;
(-s|--site)
DECAPOD_SITE_NAME=$2; shift 2;;
(-b|--bootstrap-git)
DECAPOD_BOOTSTRAP_GIT_REPO_URL=$2; shift 2;;
(-m|--manifests-git)
DECAPOD_MANIFESTS_GIT_REPO_URL=$2; shift 2;;
(-g|--git-rev)
GIT_REVISION=$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
case $1 in
-h | --help)
usage
shift 2
;;
-s | --site)
DECAPOD_SITE_NAME=$2
shift 2
;;
-b | --bootstrap-git)
DECAPOD_BOOTSTRAP_GIT_REPO_URL=$2
shift 2
;;
-m | --manifests-git)
DECAPOD_MANIFESTS_GIT_REPO_URL=$2
shift 2
;;
-g | --git-rev)
GIT_REVISION=$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
done

export DECAPOD_SITE_NAME
Expand All @@ -57,25 +72,21 @@ echo " Manifests Git: "$DECAPOD_MANIFESTS_GIT_REPO_URL
echo " Git Revision: "$GIT_REVISION

DIRS="argocd-install argocd-apps-install decapod-apps-templates"
for dir in $DIRS
do
if [[ -z $(ls | grep ${dir}) ]]
then
for dir in $DIRS; do
if [[ -z $(ls | grep ${dir}) ]]; then
echo "execute $0 in decapod-bootstrap directory"
exit 1
fi
done

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

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

0 comments on commit 38d538e

Please sign in to comment.