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

Add one click init MC Env script #940

Merged
merged 3 commits into from
Nov 8, 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
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 ""
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 ""