X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_osm.sh;h=f9031750c42492ff3f3a584a4f7194494d1f972a;hb=58851d4eeed6f6de74432a46e9eeaa35bf1d569c;hp=34494ec2f0193d757b74d31b473423ae45f0aa0e;hpb=c80394e7806dc89e012d958b71b87e48a7db20b9;p=osm%2Fdevops.git diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 34494ec2..f9031750 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -19,6 +19,10 @@ function usage(){ echo -e " OPTIONS" echo -e " --uninstall: uninstall OSM: remove the containers and delete NAT rules" echo -e " --source: install OSM from source code using the latest stable tag" + echo -e " -r : use specified repository name for osm packages" + echo -e " -R : use specified release for osm packages" + echo -e " -u : use specified repository url for osm packages" + echo -e " -k : use specified repository public key url" echo -e " -b : install OSM from source code using a specific branch (master, v2.0, ...) or tag" echo -e " -b master (main dev branch)" echo -e " -b v2.0 (v2.0 branch)" @@ -172,6 +176,9 @@ function configure(){ lxc exec RO -- openmano tenant-delete -f osm >/dev/null RO_TENANT_ID=`lxc exec RO -- openmano tenant-create osm |awk '{print $1}'` + lxc exec RO -- sed -i '/export OPENMANO_TENANT=osm/d' .bashrc + lxc exec RO -- sed -i '$ i export OPENMANO_TENANT=osm' .bashrc + #lxc exec RO -- sh -c 'echo "export OPENMANO_TENANT=osm" >> .bashrc' echo -e " Configuring VCA" JUJU_PASSWD=`date +%s | sha256sum | base64 | head -c 32` @@ -247,7 +254,7 @@ COMMIT_ID="" ASSUME_YES="" INSTALL_FROM_SOURCE="" -while getopts ":hy-:b:" o; do +while getopts ":hy-:b:r:k:u:R:" o; do case "${o}" in h) usage && exit 0 @@ -255,6 +262,18 @@ while getopts ":hy-:b:" o; do b) COMMIT_ID=${OPTARG} ;; + r) + REPOSITORY="-r ${OPTARG}" + ;; + R) + RELEASE="-R ${OPTARG}" + ;; + k) + REPOSITORY_KEY="-k ${OPTARG}" + ;; + u) + REPOSITORY_BASE="-u ${OPTARG}" + ;; -) [ "${OPTARG}" == "help" ] && usage && exit 0 [ "${OPTARG}" == "source" ] && INSTALL_FROM_SOURCE="y" && continue @@ -299,8 +318,8 @@ fi # if develop, we force master [ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master" -# if master, force install from source -[ -n "$COMMIT_ID" ] && [ "$COMMIT_ID" == "master" ] && INSTALL_FROM_SOURCE="y" +# 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" @@ -350,12 +369,14 @@ lxd --version &>/dev/null || FATAL "lxd not present, exiting." wget -q -O- https://osm-download.etsi.org/ftp/osm-2.0-two/README.txt &> /dev/null +# use local devops for containers +export OSM_USE_LOCAL_DEVOPS=true if [ -z "$INSTALL_FROM_SOURCE" ]; then echo -e "\nCreating the containers and installing from binaries ..." - $OSM_DEVOPS/jenkins/host/install RO || FATAL "RO install failed" + $OSM_DEVOPS/jenkins/host/install RO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "RO install failed" $OSM_DEVOPS/jenkins/host/start_build VCA || FATAL "VCA install failed" - $OSM_DEVOPS/jenkins/host/install SO || FATAL "SO install failed" - $OSM_DEVOPS/jenkins/host/install UI || FATAL "UI install failed" + $OSM_DEVOPS/jenkins/host/install SO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "SO install failed" + $OSM_DEVOPS/jenkins/host/install UI $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "UI install failed" else #install from source echo -e "\nCreating the containers and building from source ..." $OSM_DEVOPS/jenkins/host/start_build RO --notest checkout $COMMIT_ID || FATAL "RO container build failed (refspec: '$COMMIT_ID')"