X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_osm.sh;h=b8f0da39e4184bd4e5352b81f6d15d4aa4c8f5ed;hb=41440fc0ac6917d0922ea816b9bf8f88ce2df437;hp=4cd797a114eb31e9cb658131e8a5f7efd02b76a5;hpb=5a470344853c99a5bb291d22558cb917fdd88e3b;p=osm%2Fdevops.git diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 4cd797a1..b8f0da39 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -39,6 +39,7 @@ function usage(){ # echo -e " --update: update to the latest stable release or to the latest commit if using a specific branch" echo -e " --showopts: print chosen options and exit (only for debugging)" echo -e " -y: do not prompt for confirmation, assumes yes" + echo -e " -D use local devops installation path" echo -e " -h / --help: print this help" } @@ -559,8 +560,9 @@ LXD_REPOSITORY_PATH="" NOCONFIGURE="" RELEASE_DAILY="" SESSION_ID=`date +%s` +OSM_DEVOPS= -while getopts ":hy-:b:r:k:u:R:l:p:" o; do +while getopts ":hy-:b:r:k:u:R:l:p:D:" o; do case "${o}" in h) usage && exit 0 @@ -586,6 +588,9 @@ while getopts ":hy-:b:r:k:u:R:l:p:" o; do p) LXD_REPOSITORY_PATH="${OPTARG}" ;; + D) + OSM_DEVOPS="${OPTARG}" + ;; -) [ "${OPTARG}" == "help" ] && usage && exit 0 [ "${OPTARG}" == "source" ] && INSTALL_FROM_SOURCE="y" && continue @@ -630,13 +635,15 @@ fi # forcing source from master removed. Now only install from source when explicit # [ -n "$COMMIT_ID" ] && [ "$COMMIT_ID" == "master" ] && INSTALL_FROM_SOURCE="y" -if [ -n "$TEST_INSTALLER" ]; then - echo -e "\nUsing local devops repo for OSM installation" - TEMPDIR="$(dirname $(realpath $(dirname $0)))" -else - echo -e "\nCreating temporary dir for OSM installation" - TEMPDIR="$(mktemp -d -q --tmpdir "installosm.XXXXXX")" - trap 'rm -rf "$TEMPDIR"' EXIT +if [ -z "$OSM_DEVOPS" ]; then + if [ -n "$TEST_INSTALLER" ]; then + echo -e "\nUsing local devops repo for OSM installation" + TEMPDIR="$(dirname $(realpath $(dirname $0)))" + else + echo -e "\nCreating temporary dir for OSM installation" + TEMPDIR="$(mktemp -d -q --tmpdir "installosm.XXXXXX")" + trap 'rm -rf "$TEMPDIR"' EXIT + fi fi need_packages="git jq" @@ -648,27 +655,29 @@ for package in $need_packages; do || FATAL "failed to install $package" done -if [ -z "$TEST_INSTALLER" ]; then - echo -e "\nCloning devops repo temporarily" - git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR - RC_CLONE=$? -fi +if [ -z "$OSM_DEVOPS" ]; then + if [ -z "$TEST_INSTALLER" ]; then + echo -e "\nCloning devops repo temporarily" + git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR + RC_CLONE=$? + fi -echo -e "\nGuessing the current stable release" -LATEST_STABLE_DEVOPS=`git -C $TEMPDIR tag -l v[0-9].* | sort -V | tail -n1` -[ -z "$COMMIT_ID" ] && [ -z "$LATEST_STABLE_DEVOPS" ] && echo "Could not find the current latest stable release" && exit 0 -echo "Latest tag in devops repo: $LATEST_STABLE_DEVOPS" -[ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS" - -if [ -n "$RELEASE_DAILY" ]; then - echo "Using master/HEAD devops" - git -C $TEMPDIR checkout master -elif [ -z "$TEST_INSTALLER" ]; then - git -C $TEMPDIR checkout tags/$LATEST_STABLE_DEVOPS + echo -e "\nGuessing the current stable release" + LATEST_STABLE_DEVOPS=`git -C $TEMPDIR tag -l v[0-9].* | sort -V | tail -n1` + [ -z "$COMMIT_ID" ] && [ -z "$LATEST_STABLE_DEVOPS" ] && echo "Could not find the current latest stable release" && exit 0 + echo "Latest tag in devops repo: $LATEST_STABLE_DEVOPS" + [ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS" + + if [ -n "$RELEASE_DAILY" ]; then + echo "Using master/HEAD devops" + git -C $TEMPDIR checkout master + elif [ -z "$TEST_INSTALLER" ]; then + git -C $TEMPDIR checkout tags/$LATEST_STABLE_DEVOPS + fi + OSM_DEVOPS=$TEMPDIR fi -OSM_DEVOPS=$TEMPDIR -OSM_JENKINS="$TEMPDIR/jenkins" +OSM_JENKINS="$OSM_DEVOPS/jenkins" . $OSM_JENKINS/common/all_funcs [ -n "$UNINSTALL" ] && uninstall && echo -e "\nDONE" && exit 0 @@ -689,7 +698,7 @@ echo -e "Checking required packages: lxd" lxd --version &>/dev/null || FATAL "lxd not present, exiting." [ -n "$INSTALL_LXD" ] && echo -e "\nInstalling and configuring lxd" && install_lxd -wget -q -O- https://osm-download.etsi.org/ftp/osm-3.0-three/README.txt &> /dev/null +wget -q -O- https://osm-download.etsi.org/ftp/osm-4.0-four/README.txt &> /dev/null track start # use local devops for containers @@ -738,7 +747,7 @@ if [ -n "$INSTALL_VIMEMU" ]; then install_vimemu fi -wget -q -O- https://osm-download.etsi.org/ftp/osm-3.0-three/README2.txt &> /dev/null +wget -q -O- https://osm-download.etsi.org/ftp/osm-4.0-four/README2.txt &> /dev/null track end echo -e "\nDONE"