Disable blocking on buildable queue (Functest)
[releng.git] / jjb / fuel / fuel-logs.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2017 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 ##############################################################################
10 set -o nounset
11 set -o pipefail
12
13 # Fuel requires deploy script to be ran with sudo, Armband does not
14 SUDO='sudo -E'
15 [ "${PROJECT}" = 'fuel' ] || SUDO=
16
17 # Log file name
18 FUEL_PM_LOG_FILENAME="${JOB_NAME}_${BUILD_NUMBER}_pm.log.tar.gz"
19
20 # Construct the command
21 LOG_COMMAND="${SUDO} ${WORKSPACE}/mcp/scripts/log.sh \
22              ${WORKSPACE}/${FUEL_PM_LOG_FILENAME}"
23
24 # Log info to console
25 echo "Collecting post mortem logs ..."
26 echo "--------------------------------------------------------"
27 echo "${LOG_COMMAND}"
28
29 ${LOG_COMMAND}
30
31 # Upload logs for both baremetal and virtual deployments
32 echo "Uploading deployment logs"
33 echo "--------------------------------------------------------"
34 gsutil cp "${WORKSPACE}/${FUEL_PM_LOG_FILENAME}" \
35     "gs://${GS_URL}/logs/${FUEL_PM_LOG_FILENAME}" > /dev/null 2>&1
36 echo "Logs are available at http://${GS_URL}/logs/${FUEL_PM_LOG_FILENAME}"