2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2018 Ericsson AB, Mirantis Inc., 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 ##############################################################################
15 # set deployment parameters
16 export TMPDIR=${HOME}/tmpdir
17 # shellcheck disable=SC2153
18 LAB_NAME=${NODE_NAME/-*}
19 # shellcheck disable=SC2153
20 POD_NAME=${NODE_NAME/*-}
22 # Fuel currently supports arm, enea, ericsson, intel, lf, unh, zte and itri labs
23 if [[ ! "${LAB_NAME}" =~ (arm|enea|ericsson|intel|lf|unh|zte|itri) ]]; then
24 echo "Unsupported/unidentified lab ${LAB_NAME}. Cannot continue!"
28 echo "Using configuration for ${LAB_NAME}"
30 # create TMPDIR if it doesn't exist, change permissions
32 sudo chmod a+x "${HOME}" "${TMPDIR}"
34 cd "${WORKSPACE}" || exit 1
37 FUEL_LOG_FILENAME="${JOB_NAME}_${BUILD_NUMBER}.log.tar.gz"
39 # Limited scope for vPOD verify jobs running on armband-virtual
40 [[ ! "${JOB_NAME}" =~ verify-deploy-virtual-arm64 ]] || EXTRA_ARGS='-e'
43 [[ ${CI_DEBUG,,} == true ]] && EXTRA_ARGS="-D ${EXTRA_ARGS:-}"
45 # construct the command
46 DEPLOY_COMMAND="${WORKSPACE}/ci/deploy.sh \
47 -l ${LAB_NAME} -p ${POD_NAME} -s ${DEPLOY_SCENARIO} \
48 -S ${TMPDIR} ${EXTRA_ARGS:-} \
49 -L ${WORKSPACE}/${FUEL_LOG_FILENAME}"
52 echo "Deployment parameters"
53 echo "--------------------------------------------------------"
54 echo "Scenario: ${DEPLOY_SCENARIO}"
55 echo "Lab: ${LAB_NAME}"
56 echo "POD: ${POD_NAME}"
58 echo "Starting the deployment using ${INSTALLER_TYPE}. This could take some time..."
59 echo "--------------------------------------------------------"
62 # start the deployment
63 echo "Issuing command"
64 echo "${DEPLOY_COMMAND}"
71 echo "--------------------------------------------------------"
72 echo "Deployment is done!"
74 # upload logs for baremetal deployments
75 # work with virtual deployments is still going on, so skip that for now
76 if [[ "${JOB_NAME}" =~ baremetal-daily ]]; then
77 echo "Uploading deployment logs"
78 gsutil cp "${WORKSPACE}/${FUEL_LOG_FILENAME}" \
79 "gs://${GS_URL}/logs/${FUEL_LOG_FILENAME}" > /dev/null 2>&1
80 echo "Logs are available at http://${GS_URL}/logs/${FUEL_LOG_FILENAME}"
83 if [[ "${exit_code}" -ne 0 ]]; then
84 echo "Deployment failed!"
88 echo "Deployment is successful!"