echo -e "Install OSM from source code"
echo -e " OPTIONS"
echo -e " --uninstall: uninstall OSM: remove the containers and delete NAT rules"
- echo -e " -b <branch>: install OSM from source code using a specific branch (master, v1.0, ...)"
+ echo -e " -b <branch>: install OSM from source code using a specific branch (master, v1.0, ...) or tag"
echo -e " -b master"
echo -e " -b v1.0"
+ echo -e " -b tags/v1.1.0"
echo -e " ..."
echo -e " --develop: (deprecated, use '-b master') install OSM from source code using the master branch"
echo -e " --nat: install only NAT rules"
esac
done
+if [ -n "$SHOWOPTS" ]; then
+ echo "DEVELOP=$DEVELOP"
+ echo "UNINSTALL=$UNINSTALL"
+ echo "NAT=$NAT"
+ echo "UPDATE=$UPDATE"
+ echo "RECONFIGURE=$RECONFIGURE"
+ echo "TEST_INSTALLER=$TEST_INSTALLER"
+ echo "LXD=$LXD"
+ echo "SHOWOPTS=$SHOWOPTS"
+ echo "Install from specific refspec (-b): $COMMIT_ID"
+ exit 0
+fi
+
[ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
[ -n "$TEST_INSTALLER" ] && [ -z "$COMMIT_ID" ] && echo "Use -b option to specify the branch to use for the test (e.g.: v1.0)" && exit 0
echo -e "\nGuessing the current stable release"
LATEST_STABLE_DEVOPS=`git -C $TEMPDIR tag -l v[0-9].* | tail -n1`
[ -z "$COMMIT_ID" ] && [ -z "$LATEST_STABLE_DEVOPS" ] && echo "Could not find the current latest stable release" && exit 0
-
-if [ -n "$SHOWOPTS" ]; then
- echo "DEVELOP=$DEVELOP"
- echo "UNINSTALL=$UNINSTALL"
- echo "NAT=$NAT"
- echo "UPDATE=$UPDATE"
- echo "RECONFIGURE=$RECONFIGURE"
- echo "TEST_INSTALLER=$TEST_INSTALLER"
- echo "LXD=$LXD"
- echo "SHOWOPTS=$SHOWOPTS"
- echo "Latest tag in devops repo: $LATEST_STABLE_DEVOPS"
- echo "Commit to be installed (-b): $COMMIT_ID"
- exit 0
-fi
+echo "Latest tag in devops repo: $LATEST_STABLE_DEVOPS"
+[ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS"
+[ -z "$TEST_INSTALLER" ] && git -C $TEMPDIR checkout $LATEST_STABLE_DEVOPS
+echo -e "\n Installing OSM from refspec: $COMMIT_ID"
OSM_DEVOPS=$TEMPDIR
OSM_JENKINS="$TEMPDIR/jenkins"
echo -e "Checking required packages: lxd"
lxd --version &>/dev/null || echo -e "lxd not present, exiting " >&2 && exit 1
-[ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS"
-echo -e "\n Installing OSM from refspec: $COMMIT_ID"
-
wget -q -O- https://osm-download.etsi.org/ftp/osm-1.0-one/README.txt &> /dev/null
[ -n "$LXD" ] && echo -e "\nConfiguring lxd" && install_lxd