From 2a5a6513e8997654a00aa92c1a42220343c9bd94 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Mon, 19 Dec 2016 10:19:52 +0100 Subject: [PATCH] Install new tag: tags/v1.0.2. Added -b option to the installer to checkout specific branch/commit. Added hidden options (lxd, showopts) to be tested. Change-Id: Ic4d16c8596de90a13b8f1949e23158dbf8cda935 Signed-off-by: garciadeblas --- installers/install_from_source.sh | 43 +++++++++++++++++++++++++++---- jenkins/RO/start_build | 4 +++ 2 files changed, 42 insertions(+), 5 deletions(-) mode change 100644 => 100755 installers/install_from_source.sh diff --git a/installers/install_from_source.sh b/installers/install_from_source.sh old mode 100644 new mode 100755 index 5b794e52..7549dfbf --- a/installers/install_from_source.sh +++ b/installers/install_from_source.sh @@ -18,7 +18,8 @@ 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 " --develop: install OSM from source code using the master branch" + echo -e " -b : install OSM from source code using a specific branch (master, v1.0, ...)" + 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 " -h / --help: print this help" } @@ -91,16 +92,32 @@ function configure(){ } +function install_lxd() { + lxd init --auto + lxd waitready + systemctl stop lxd-bridge + systemctl --system daemon-reload + systemctl enable lxd-bridge + systemctl start lxd-bridge +} + + UNINSTALL="" DEVELOP="" NAT="" RECONFIGURE="" TEST_INSTALLER="" -while getopts ":h-:" o; do +LXD="" +SHOWOPTS="" +COMMIT_ID="" +while getopts ":h-:b:" o; do case "${o}" in h) usage && exit 0 ;; + b) + COMMIT_ID=${OPTARG} + ;; -) [ "${OPTARG}" == "help" ] && usage && exit 0 [ "${OPTARG}" == "develop" ] && DEVELOP="y" && continue @@ -108,6 +125,8 @@ while getopts ":h-:" o; do [ "${OPTARG}" == "nat" ] && NAT="y" && continue [ "${OPTARG}" == "reconfigure" ] && RECONFIGURE="y" && continue [ "${OPTARG}" == "test" ] && TEST_INSTALLER="y" && continue + [ "${OPTARG}" == "lxd" ] && LXD="y" && continue + [ "${OPTARG}" == "showopts" ] && SHOWOPTS="y" && continue echo -e "Invalid option: '--$OPTARG'\n" >&2 usage && exit 1 ;; @@ -121,6 +140,20 @@ while getopts ":h-:" o; do esac done +[ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master" +[ -z "$COMMIT_ID" ] && COMMIT_ID="tags/v1.0.2" + +if [ -n "$SHOWOPTS" ]; then + echo "UNINSTALL=$UNINSTALL" + echo "DEVELOP=$DEVELOP" + echo "NAT=$NAT" + echo "RECONFIGURE=$RECONFIGURE" + echo "TEST_INSTALLER=$TEST_INSTALLER" + echo "LXD=$LXD" + echo "Commit: $COMMIT_ID" + exit 0 +fi + if [ -n "$TEST_INSTALLER" ]; then echo -e "\nUsing local devops repo for OSM installation" TEMPDIR="$(dirname $(realpath $(dirname $0)))" @@ -136,7 +169,7 @@ if [ -z "$TEST_INSTALLER" ]; then echo -e "\nCloning devops repo temporarily" git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR RC_CLONE=$? - DEVOPS_COMMITID="tags/v1.0.1" + DEVOPS_COMMITID="tags/v1.0.2" git -C $TEMPDIR checkout $DEVOPS_COMMITID fi OSM_DEVOPS=$TEMPDIR @@ -150,12 +183,12 @@ OSM_JENKINS="$TEMPDIR/jenkins" #Installation starts here 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 + 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 ..." -COMMIT_ID="tags/v1.0.1" -[ -n "$DEVELOP" ] && COMMIT_ID="master" $OSM_DEVOPS/jenkins/host/start_build RO checkout $COMMIT_ID $OSM_DEVOPS/jenkins/host/start_build VCA $OSM_DEVOPS/jenkins/host/start_build SO checkout $COMMIT_ID diff --git a/jenkins/RO/start_build b/jenkins/RO/start_build index c711cd7b..8dcdd81b 100755 --- a/jenkins/RO/start_build +++ b/jenkins/RO/start_build @@ -35,6 +35,10 @@ rm -f *.pyc INFO " installing openmano packages and dependencies from current repo (--noclone)" ./scripts/install-openmano.sh --noclone -q INFO " compiling *.py" +#TEMPFILE="$(mktemp -q -p . "openmanolinker.XXXXXX.py")" +#trap 'rm -f "$TEMPFILE"' EXIT +#for i in vimconn*.py; do echo "import $i" >> $TEMPFILE; done +#python $TEMPFILE && python -m py_compile *.py #&& #uncomment to concatenate commands #basic test HERE #&& #uncomment to concatenate commands -- 2.25.1