-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from openinfradev/v2_air-gap
오프라인 환경을 위한 사이트 생성 스크립트 수정
- Loading branch information
Showing
22 changed files
with
80 additions
and
838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
*-manifest.yaml | ||
decapod-base-yaml | ||
cd | ||
output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,55 @@ | ||
#!/bin/bash | ||
DECAPOD_BASE_URL=https://github.com/openinfradev/decapod-base-yaml.git | ||
BRANCH="main" | ||
|
||
if [ $# -eq 0 ]; then | ||
echo 'Error: Missing Arguments "site name"' | ||
exit 1 | ||
fi | ||
SITE_NAME=$1 | ||
|
||
git clone $DECAPOD_BASE_URL .base-yaml | ||
for i in `ls -d .base-yaml/*/ | grep -v docs | sed 's/.base-yaml\///g'` | ||
do | ||
mkdir -p $SITE_NAME/$i | ||
cp .base-yaml/${i}base/site-values.yaml $SITE_NAME/$i | ||
kustomization="$SITE_NAME/${i}kustomization.yaml" | ||
echo "resources:" > $kustomization | ||
echo " - ../base" >> $kustomization | ||
echo "transformers:" >> $kustomization | ||
echo " - site-values.yaml" >> $kustomization | ||
set -e | ||
|
||
BASE_SITE="hanu-reference" | ||
|
||
function usage { | ||
echo -e "\nUsage: ./$0 site_name [--helm-repo LOCAL_HELM_REPO --registry IMAGE_LOCAL_REGISTRY]" | ||
exit 1 | ||
} | ||
|
||
# We use "$@" instead of $* to preserve argument-boundary information | ||
ARGS=$(getopt -o 'h:r:' --long 'helm-repo:,registry:' -- "$@") || usage | ||
eval "set -- $ARGS" | ||
|
||
while true; do | ||
case $1 in | ||
(-h|--helm-repo) | ||
LOCAL_HELM_REPO=$2; shift 2;; | ||
(-r|--registry) | ||
LOCAL_REGISTRY=$2; shift 2;; | ||
(--) shift; break;; | ||
(*) exit 1;; # error | ||
esac | ||
done | ||
SITE_NAME=("$@") | ||
|
||
[ -z $SITE_NAME ] && echo 'Error: missing argument "site_name"' && usage | ||
[ -e $SITE_NAME ] && echo "Error: \"$SITE_NAME\" already exists" && usage | ||
[ ! -z $LOCAL_HELM_REPO ] && [ -z $LOCAL_REGISTRY ] && echo 'Error: Helm repo and Container registry must be specified together' && usage | ||
[ -z $LOCAL_HELM_REPO ] && [ ! -z $LOCAL_REGISTRY ] && echo 'Error: Helm repo and Container registry must be specified together' && usage | ||
|
||
rm -rf .base-yaml | ||
[ ! -z $LOCAL_HELM_REPO ] && offline=true && echo "Helm repo: "$LOCAL_HELM_REPO | ||
[ ! -z $LOCAL_REGISTRY ] && echo "Container Image Registry: "$LOCAL_REGISTRY | ||
export LOCAL_HELM_REPO | ||
export LOCAL_REGISTRY | ||
|
||
if [ "$offline" = true ] | ||
then | ||
BASE_SITE="hanu-reference-offline" | ||
fi | ||
|
||
echo "=== new site $SITE_NAME is creating from $BASE_SITE..." | ||
|
||
cp -r $BASE_SITE $SITE_NAME | ||
|
||
if [ "$offline" = true ] | ||
then | ||
for yaml in $(find $SITE_NAME -type f -name site-values.yaml -o -name image-values.yaml) | ||
do | ||
cp $yaml .tmp-yaml | ||
cat .tmp-yaml | envsubst > $yaml | ||
rm .tmp-yaml | ||
done | ||
fi |
This file was deleted.
Oops, something went wrong.
200 changes: 0 additions & 200 deletions
200
gate-centos-lb-ceph-online-multinodes/lma/site-values.yaml
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
gate-centos-lb-ceph-online-multinodes/openstack/kustomization.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.