2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 # source the file so we get OPNFV vars
15 source latest.properties
17 # echo the info about artifact that is used during the deployment
18 echo "Using ${OPNFV_ARTIFACT_URL/*\/} for deployment"
20 if [[ "$JOB_NAME" =~ "merge" ]]; then
21 # set simplest scenario for virtual deploys to run for merges
22 DEPLOY_SCENARIO="os-nosdn-nofeature-ha"
24 # for none-merge deployments
25 # checkout the commit that was used for building the downloaded artifact
26 # to make sure the ISO and deployment mechanism uses same versions
27 echo "Checking out $OPNFV_GIT_SHA1"
28 git checkout $OPNFV_GIT_SHA1 --quiet
31 # set deployment parameters
32 export TMPDIR=$HOME/tmpdir
34 LAB_NAME=${NODE_NAME/-*}
35 POD_NAME=${NODE_NAME/*-}
37 if [[ "$NODE_NAME" == "opnfv-jump-2" ]]; then
42 if [[ "$NODE_NAME" =~ "virtual" ]]; then
43 POD_NAME="virtual_kvm"
46 # we currently support ericsson, intel, and lf labs
47 if [[ ! "$LAB_NAME" =~ (ericsson|intel|lf) ]]; then
48 echo "Unsupported/unidentified lab $LAB_NAME. Cannot continue!"
51 echo "Using configuration for $LAB_NAME"
54 # create TMPDIR if it doesn't exist
55 export TMPDIR=$HOME/tmpdir
58 # change permissions down to TMPDIR
62 # clone the securedlab repo
64 echo "Cloning securedlab repo ${GIT_BRANCH##origin/}"
65 git clone ssh://jenkins-ericsson@gerrit.opnfv.org:29418/securedlab --quiet --branch ${GIT_BRANCH##origin/}
67 # construct the command
68 DEPLOY_COMMAND="sudo $WORKSPACE/ci/deploy.sh -b file://$WORKSPACE/securedlab -l $LAB_NAME -p $POD_NAME -s $DEPLOY_SCENARIO -i file://$WORKSPACE/opnfv.iso -H -B $BRIDGE -S $TMPDIR"
71 echo "Deployment parameters"
72 echo "--------------------------------------------------------"
73 echo "Scenario: $DEPLOY_SCENARIO"
76 echo "ISO: ${OPNFV_ARTIFACT_URL/*\/}"
78 echo "Starting the deployment using $INSTALLER_TYPE. This could take some time..."
79 echo "--------------------------------------------------------"
82 # start the deployment
83 echo "Issuing command"
84 echo "$DEPLOY_COMMAND"
90 echo "--------------------------------------------------------"