2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2019 Enea Software 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 # set deployment parameters
15 export TMPDIR=${HOME}/tmpdir
16 if [ "$(uname -m)" = 'aarch64' ]; then
18 # shellcheck disable=SC2153
19 POD_NAME=${NODE_NAME/*ubuntu1804-dev-48c-256g-/virtual}
20 if [[ ! "$POD_NAME" =~ virtual ]]; then
21 POD_NAME=${NODE_NAME/*ubuntu1804-dev-96c-256g-/baremetal}
23 if [[ ! "$POD_NAME" =~ (virtual|baremetal) ]]; then
24 POD_NAME=${NODE_NAME/*ubuntu1804-dev-32c-128g-/baremetal}
28 if [[ ! "$POD_NAME" =~ (virtual|baremetal) ]]; then
29 echo "Unavailable hardware. Cannot continue!"
33 echo "Using configuration for ${LAB_NAME}"
35 # create TMPDIR if it doesn't exist, change permissions
37 sudo chmod a+x "${HOME}" "${TMPDIR}"
39 cd "${WORKSPACE}" || exit 1
42 # shellcheck disable=SC2153
43 FUEL_LOG_FILENAME="${JOB_NAME}_${BUILD_NUMBER}.log.tar.gz"
46 [ "${CI_DEBUG,,}" == 'true' ] && EXTRA_ARGS="-D ${EXTRA_ARGS:-}"
48 # construct the command
49 git clone https://github.com/opnfv/fuel.git
51 DEPLOY_COMMAND="fuel/ci/deploy.sh \
52 -l ${LAB_NAME} -p ${POD_NAME} -s ${DEPLOY_SCENARIO} \
53 -S ${TMPDIR} ${EXTRA_ARGS:-} \
54 -b file://${WORKSPACE}/ci
55 -L ${WORKSPACE}/${FUEL_LOG_FILENAME}"
58 echo "Deployment parameters"
59 echo "--------------------------------------------------------"
60 echo "Scenario: ${DEPLOY_SCENARIO}"
61 echo "Lab: ${LAB_NAME}"
62 echo "POD: ${POD_NAME}"
64 echo "Starting the deployment using Fuel. This could take some time..."
65 echo "--------------------------------------------------------"
68 # start the deployment
69 echo "Issuing command"
70 echo "${DEPLOY_COMMAND}"
76 echo "--------------------------------------------------------"
77 echo "Deployment is done!"
79 if [ "${exit_code}" -ne 0 ]; then
80 echo "Deployment failed!"
84 echo "Deployment is successful!"