Skip to content

Commit

Permalink
Add one click init MC Env script (#940)
Browse files Browse the repository at this point in the history
* Add oneclick initMC Env script

* Change default ns name

* Add script to load common resource
  • Loading branch information
jihoon-seo authored Nov 8, 2021
2 parents ee3a5df + ffd85b9 commit beeebac
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 12 deletions.
54 changes: 54 additions & 0 deletions scripts/initMultiCloudEnv.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 0 additions & 8 deletions scripts/registerCloudInfo.sh

This file was deleted.

5 changes: 4 additions & 1 deletion src/testclient/scripts/2.configureTumblebug/create-ns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$(
Expand Down
2 changes: 1 addition & 1 deletion src/testclient/scripts/2.configureTumblebug/delete-ns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
2 changes: 1 addition & 1 deletion src/testclient/scripts/2.configureTumblebug/get-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion src/testclient/scripts/2.configureTumblebug/get-ns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Original file line number Diff line number Diff line change
@@ -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 ""

0 comments on commit beeebac

Please sign in to comment.