From e1ef70842479ced38c45c4ab921d93fe78cc78cb Mon Sep 17 00:00:00 2001 From: seokho-son Date: Mon, 8 Nov 2021 17:54:43 +0900 Subject: [PATCH 1/3] Add oneclick initMC Env script --- scripts/initMultiCloudEnv.sh | 54 ++++++++++++++++++++++++++++++++++++ scripts/registerCloudInfo.sh | 8 ------ 2 files changed, 54 insertions(+), 8 deletions(-) create mode 100755 scripts/initMultiCloudEnv.sh delete mode 100755 scripts/registerCloudInfo.sh diff --git a/scripts/initMultiCloudEnv.sh b/scripts/initMultiCloudEnv.sh new file mode 100755 index 000000000..839214813 --- /dev/null +++ b/scripts/initMultiCloudEnv.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +if [ -z "$CBTUMBLEBUG_ROOT" ]; then + SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` + export CBTUMBLEBUG_ROOT=`cd $SCRIPT_DIR && cd .. && pwd` +fi + +$CBTUMBLEBUG_ROOT/src/testclient/scripts/1.configureSpider/register-cloud-interactive.sh -n tb + +echo -e "${BOLD}" +while true; do + read -p 'Load common Specs and Images. Do you want to proceed ? (y/n) : ' CHECKPROCEED + echo -e "${NC}" + case $CHECKPROCEED in + [Yy]*) + break + ;; + [Nn]*) + echo + echo "Cancel [$0 $@]" + echo "See you soon. :)" + echo + exit 1 + ;; + *) + echo "Please answer yes or no." + ;; + esac +done + +$CBTUMBLEBUG_ROOT/src/testclient/scripts/2.configureTumblebug/load-common-resource.sh -n tb + +echo -e "${BOLD}" +while true; do + read -p 'Create default namespace (ns01). Do you want to proceed ? (y/n) : ' CHECKPROCEED + echo -e "${NC}" + case $CHECKPROCEED in + [Yy]*) + break + ;; + [Nn]*) + echo + echo "Cancel [$0 $@]" + echo "See you soon. :)" + echo + exit 1 + ;; + *) + echo "Please answer yes or no." + ;; + esac +done + +$CBTUMBLEBUG_ROOT/src/testclient/scripts/2.configureTumblebug/create-ns.sh -n tb diff --git a/scripts/registerCloudInfo.sh b/scripts/registerCloudInfo.sh deleted file mode 100755 index 7818d8728..000000000 --- a/scripts/registerCloudInfo.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [ -z "$CBTUMBLEBUG_ROOT" ]; then - SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` - export CBTUMBLEBUG_ROOT=`cd $SCRIPT_DIR && cd .. && pwd` -fi - -$CBTUMBLEBUG_ROOT/src/testclient/scripts/1.configureSpider/register-cloud-interactive.sh -n tb From dc44ab246bd6ab63bd144fc57c3b6405188eee2d Mon Sep 17 00:00:00 2001 From: seokho-son Date: Mon, 8 Nov 2021 17:55:40 +0900 Subject: [PATCH 2/3] Change default ns name --- src/testclient/scripts/2.configureTumblebug/create-ns.sh | 5 ++++- src/testclient/scripts/2.configureTumblebug/delete-ns.sh | 2 +- src/testclient/scripts/2.configureTumblebug/get-config.sh | 2 +- src/testclient/scripts/2.configureTumblebug/get-ns.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/testclient/scripts/2.configureTumblebug/create-ns.sh b/src/testclient/scripts/2.configureTumblebug/create-ns.sh index 14b0db82d..c193f1d3d 100755 --- a/src/testclient/scripts/2.configureTumblebug/create-ns.sh +++ b/src/testclient/scripts/2.configureTumblebug/create-ns.sh @@ -4,10 +4,13 @@ echo "####################################################################" echo "## 2. Namespace: Create (-x option for NameSpace Name)" echo "####################################################################" +SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` +cd $SCRIPT_DIR + source ../init.sh if [ -z "$NSID" ]; then - NSID=${OPTION01:-tb01} + NSID=${OPTION01:-ns01} fi resp=$( diff --git a/src/testclient/scripts/2.configureTumblebug/delete-ns.sh b/src/testclient/scripts/2.configureTumblebug/delete-ns.sh index aa3e1e15e..0c5f1e39f 100755 --- a/src/testclient/scripts/2.configureTumblebug/delete-ns.sh +++ b/src/testclient/scripts/2.configureTumblebug/delete-ns.sh @@ -6,7 +6,7 @@ echo "####################################################################" source ../init.sh -NSID=${OPTION01:-tb01} +NSID=${OPTION01:-ns01} curl -H "${AUTH}" -sX DELETE http://$TumblebugServer/tumblebug/ns/$NSID | jq '' echo "" diff --git a/src/testclient/scripts/2.configureTumblebug/get-config.sh b/src/testclient/scripts/2.configureTumblebug/get-config.sh index 16d8f5581..25943a047 100755 --- a/src/testclient/scripts/2.configureTumblebug/get-config.sh +++ b/src/testclient/scripts/2.configureTumblebug/get-config.sh @@ -8,7 +8,7 @@ source ../init.sh - VAR=${OPTION01:-tb01} + VAR=${OPTION01:-ns01} curl -H "${AUTH}" -sX GET http://$TumblebugServer/tumblebug/config/$VAR | jq '' echo "" diff --git a/src/testclient/scripts/2.configureTumblebug/get-ns.sh b/src/testclient/scripts/2.configureTumblebug/get-ns.sh index 5da3e8084..7c0820c03 100755 --- a/src/testclient/scripts/2.configureTumblebug/get-ns.sh +++ b/src/testclient/scripts/2.configureTumblebug/get-ns.sh @@ -6,7 +6,7 @@ echo "####################################################################" source ../init.sh -NSID=${OPTION01:-tb01} +NSID=${OPTION01:-ns01} curl -H "${AUTH}" -sX GET http://$TumblebugServer/tumblebug/ns/$NSID | jq '' echo "" From ffd85b9aedcd29724b43e45a9e61dad6f2045e39 Mon Sep 17 00:00:00 2001 From: seokho-son Date: Mon, 8 Nov 2021 17:56:04 +0900 Subject: [PATCH 3/3] Add script to load common resource --- .../2.configureTumblebug/load-common-resource.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 src/testclient/scripts/2.configureTumblebug/load-common-resource.sh diff --git a/src/testclient/scripts/2.configureTumblebug/load-common-resource.sh b/src/testclient/scripts/2.configureTumblebug/load-common-resource.sh new file mode 100755 index 000000000..222e214cc --- /dev/null +++ b/src/testclient/scripts/2.configureTumblebug/load-common-resource.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "####################################################################" +echo "## Load common Image and Spec from asset files" +echo "## (assets/cloudspec.csv, assets/cloudimage.csv)" +echo "####################################################################" + +SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` +cd $SCRIPT_DIR + +source ../init.sh + +curl -H "${AUTH}" -sX GET http://$TumblebugServer/tumblebug/loadCommonResource | jq '' +echo ""