2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # (c) 2016 Enea Software AB
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
15 # source the file so we get OPNFV vars
16 source latest.properties
18 # echo the info about artifact that is used during the deployment
19 echo "Using ${OPNFV_ARTIFACT_URL/*\/} for deployment"
21 if [[ "$JOB_NAME" =~ "merge" ]]; then
22 # set simplest scenario for virtual deploys to run for merges
23 DEPLOY_SCENARIO="os-nosdn-nofeature-ha"
25 # for none-merge deployments
26 # checkout the commit that was used for building the downloaded artifact
27 # to make sure the ISO and deployment mechanism uses same versions
28 echo "Checking out $OPNFV_GIT_SHA1"
29 git checkout $OPNFV_GIT_SHA1 --quiet
32 # set deployment parameters
33 export TMPDIR=$HOME/tmpdir
34 BRIDGE=${DEFAULT_BRIDGE:-pxebr}
35 LAB_NAME=${NODE_NAME/-*}
36 POD_NAME=${NODE_NAME/*-}
38 # we currently support enea
39 if [[ ! $LAB_NAME =~ (arm|enea) ]]; then
40 echo "Unsupported/unidentified lab $LAB_NAME. Cannot continue!"
44 echo "Using configuration for $LAB_NAME"
46 # create TMPDIR if it doesn't exist
50 if [[ $LAB_CONFIG_URL =~ ^git:// ]]; then
51 git clone --quiet --branch ${GIT_BRANCH##origin/} $LAB_CONFIG_URL lab-config
52 LAB_CONFIG_URL=file://${WORKSPACE}/lab-config
55 # releng wants us to use nothing else but opnfv.iso for now. We comply.
56 ISO_FILE=$WORKSPACE/opnfv.iso
58 # construct the command
59 DEPLOY_COMMAND="$WORKSPACE/ci/deploy.sh -l $LAB_NAME -p $POD_NAME -b ${LAB_CONFIG_URL} -s $DEPLOY_SCENARIO -i file://${ISO_FILE} -H -B $BRIDGE -S $TMPDIR"
62 echo "Deployment parameters"
63 echo "--------------------------------------------------------"
64 echo "Scenario: $DEPLOY_SCENARIO"
67 echo "ISO: ${OPNFV_ARTIFACT_URL/*\/}"
69 echo "Starting the deployment using $INSTALLER_TYPE. This could take some time..."
70 echo "--------------------------------------------------------"
73 # start the deployment
74 echo "Issuing command"
75 echo "$DEPLOY_COMMAND"
81 echo "--------------------------------------------------------"
82 echo "Deployment is done successfully!"