CORD-755 Add -v flag to print version
(cherry picked from commit e2acb980fd545afd0246995fdda35381292f937d)
Change-Id: If5dea2671672f42e5ce7ae2b30d9dc66006c6fc8
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index 4a410ea..f34aaba 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -7,6 +7,10 @@
CONFIG=config/cord_in_a_box.yml
SSHCONFIG=~/.ssh/config
+# For CORD version
+REPO_BRANCH="master"
+VERSION_STRING="CiaB development version"
+
function cleanup_from_previous_test() {
echo "## Cleanup ##"
@@ -43,7 +47,7 @@
git config --global user.email 'test@null.com'
git config --global color.ui false
- repo init -u https://gerrit.opencord.org/manifest -b master -g build,onos,orchestration
+ repo init -u https://gerrit.opencord.org/manifest -b $REPO_BRANCH -g build,onos,orchestration
repo sync
# check out gerrit branches using repo
@@ -168,7 +172,7 @@
#needed, use -n option
NUM_COMPUTE_NODES=1
-while getopts "b:cdhn:st" opt; do
+while getopts "b:cdhn:stv" opt; do
case ${opt} in
b ) GERRIT_BRANCHES+=("$OPTARG")
;;
@@ -186,6 +190,7 @@
echo " $0 -n number of compute nodes to setup. currently max 2 nodes can be supported"
echo " $0 -s run initial setup phase only (don't start building CORD)"
echo " $0 -t do install, bring up cord-pod configuration, run E2E test"
+ echo " $0 -v print CiaB version and exit"
exit 0
;;
n ) NUM_COMPUTE_NODES=$OPTARG
@@ -194,6 +199,9 @@
;;
t ) RUN_TEST=1
;;
+ v ) echo "$VERSION_STRING ($REPO_BRANCH branch)"
+ exit 0
+ ;;
\? ) echo "Invalid option: -$OPTARG"
exit 1
;;
@@ -206,6 +214,10 @@
cleanup_from_previous_test
fi
+echo ""
+echo "Preparing to install $VERSION_STRING ($REPO_BRANCH branch)"
+echo ""
+
bootstrap
cloudlab_setup
vagrant_vms_up