From 95f164ef1ae820c00d6fe6078ac481540c2aa154 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 19 Oct 2016 13:00:54 +0200 Subject: [PATCH] VCA start_build modified to take into account changes in juju client. OSM installer from source modified to check dependencies before installing Change-Id: Ic7a6ef5d548a5d8cb0d09c405ba94a094c8c01f9 Signed-off-by: garciadeblas --- installers/install_from_source.sh | 19 +++++++++++++------ jenkins/VCA/start_build | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/installers/install_from_source.sh b/installers/install_from_source.sh index bb0ca7e2..3a1c959e 100755 --- a/installers/install_from_source.sh +++ b/installers/install_from_source.sh @@ -53,8 +53,13 @@ echo -e "\nCreating temporary dir for OSM installation" TEMPDIR="$(mktemp -d -q --tmpdir "installosm.XXXXXX")" trap 'rm -rf "$TEMPDIR"' EXIT +echo -e "Checking required packages: git" +dpkg -l git &>/dev/null || ! echo -e " git not installed.\nInstalling git requires root privileges" || sudo apt install -y git echo -e "\nCloning devops repo temporarily" git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR +#DEVOPS_COMMITID="tags/v1.0.0" +DEVOPS_COMMITID="master" +git -C $TEMPDIR checkout $DEVOPS_COMMITID RC_CLONE=$? OSM_DEVOPS=$TEMPDIR OSM_JENKINS="$TEMPDIR/jenkins" @@ -75,6 +80,9 @@ if [ -n "$UNINSTALL" ]; then fi if [ -n "$NAT" ]; then + echo -e "\nChecking required packages: iptables-persistent" + dpkg -l iptables-persistent &>/dev/null || ! echo -e " Not installed.\nInstalling iptables-persistent requires root privileges" || \ + sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install iptables-persistent sudo $OSM_DEVOPS/installers/nat_osm exit 0 fi @@ -82,12 +90,11 @@ fi #Installation starts here wget -q -O- https://osm-download.etsi.org/ftp/osm-1.0-one/README.txt &> /dev/null -echo -e "\nInstalling required packages: git, wget, curl, tar" -echo -e " Required root privileges" -sudo apt install -y git wget curl tar +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" +COMMIT_ID="tags/v1.0.0" #COMMIT_ID="master" [ -n "$DEVELOP" ] && COMMIT_ID="master" $OSM_DEVOPS/jenkins/host/start_build RO checkout $COMMIT_ID @@ -96,8 +103,8 @@ $OSM_DEVOPS/jenkins/host/start_build SO checkout $COMMIT_ID $OSM_DEVOPS/jenkins/host/start_build UI checkout $COMMIT_ID #Install iptables-persistent -echo -e "\nInstalling iptables-persistent" -echo -e " Required root privileges" +echo -e "\nChecking required packages: iptables-persistent" +dpkg -l iptables-persistent &>/dev/null || ! echo -e " Not installed.\nInstalling iptables-persistent requires root privileges" || \ sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install iptables-persistent #Configure NAT rules diff --git a/jenkins/VCA/start_build b/jenkins/VCA/start_build index 5830d0e5..1724d8e5 100755 --- a/jenkins/VCA/start_build +++ b/jenkins/VCA/start_build @@ -51,7 +51,7 @@ lxc image copy ubuntu:16.04 local: --alias ubuntu-xenial add-apt-repository -y ppa:juju/devel apt update apt install -y juju -juju bootstrap juju localhost +juju bootstrap localhost osm RC=0 -- 2.25.1