X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_from_source.sh;h=fbf0f02150e3e272344fa157d25b7ee3fa8f6f9b;hb=237cfd5ccce2da5eab0e5574ae899a4407215293;hp=49cabfbcaed5f2ebf6dc6893c9e14f7d380c6e8b;hpb=2a382730c472ce6590fd81145d32577ca9e9049b;p=osm%2Fdevops.git diff --git a/installers/install_from_source.sh b/installers/install_from_source.sh index 49cabfbc..fbf0f021 100755 --- a/installers/install_from_source.sh +++ b/installers/install_from_source.sh @@ -24,8 +24,9 @@ function usage(){ 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" - echo -e " --update: update to the latest stable release or to the latest commit if using a specific branch" - echo -e " --showopts: show current options" +# 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 " -h / --help: print this help" } @@ -188,8 +189,9 @@ TEST_INSTALLER="" LXD="" SHOWOPTS="" COMMIT_ID="" +ASSUME_YES="" -while getopts ":h-:b:" o; do +while getopts ":hy-:b:" o; do case "${o}" in h) usage && exit 0 @@ -214,6 +216,9 @@ while getopts ":h-:b:" o; do echo -e "Invalid option: '-$OPTARG'\n" >&2 usage && exit 1 ;; + y) + ASSUME_YES="y" + ;; *) usage && exit 1 ;; @@ -268,6 +273,12 @@ OSM_JENKINS="$TEMPDIR/jenkins" [ -n "$RECONFIGURE" ] && configure && echo -e "\nDONE" && exit 0 #Installation starts here +if [ -z "$ASSUME_YES" ]; then + read -e -p "The installation will take about 75-90 minutes. Continue (Y/n)?" USER_CONFIRMATION + [ -n "$USER_CONFIRMATION" ] && [ "$USER_CONFIRMATION" != "yes" ] && \ + [ "$USER_CONFIRMATION" != "y" ] && echo "Cancelled!" && exit 0 +fi + [ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS" echo -e "\n Installing OSM from refspec: $COMMIT_ID" @@ -279,7 +290,7 @@ echo -e "\nChecking required packages: wget, curl, tar" dpkg -l wget curl tar &>/dev/null || ! echo -e " One or several packages are not installed.\nInstalling required packages\n Root privileges are required" || sudo apt install -y wget curl tar echo -e "\nCreating the containers and building ..." -$OSM_DEVOPS/jenkins/host/start_build RO checkout $COMMIT_ID +$OSM_DEVOPS/jenkins/host/start_build RO --notest checkout $COMMIT_ID $OSM_DEVOPS/jenkins/host/start_build VCA $OSM_DEVOPS/jenkins/host/start_build SO checkout $COMMIT_ID $OSM_DEVOPS/jenkins/host/start_build UI checkout $COMMIT_ID @@ -291,5 +302,4 @@ nat configure echo -e "\nDONE" - - +wget -q -O- https://osm-download.etsi.org/ftp/osm-1.0-one/README2.txt &> /dev/null