From: garciadeblas Date: Fri, 7 Apr 2017 00:00:29 +0000 (+0200) Subject: Checkout last tag in devops; showopts does not download X-Git-Tag: v1.1.1~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=a6ff9867e4575efddd47c20ca88394331d62789d;p=osm%2Fdevops.git Checkout last tag in devops; showopts does not download Change-Id: Ibac8af930fd3530accea5d770f92a9537c505d31 Signed-off-by: garciadeblas --- diff --git a/installers/install_from_source.sh b/installers/install_from_source.sh index 02d9e05a..cf706a97 100755 --- a/installers/install_from_source.sh +++ b/installers/install_from_source.sh @@ -18,9 +18,10 @@ function usage(){ 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 : install OSM from source code using a specific branch (master, v1.0, ...)" + echo -e " -b : 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" @@ -225,6 +226,19 @@ while getopts ":hy-:b:" o; do 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 @@ -248,20 +262,10 @@ fi 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" @@ -282,9 +286,6 @@ fi 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