7 echo "Fetching logs from overcloud. This could take some time..."
8 echo "--------------------------------------------------------"
11 if sudo opnfv-pyutil --fetch-logs; then
12 LOG_LOCATION=$(cat apex_util.log | grep 'Log retrieval complete' | grep -Eo '/tmp/.+$')
13 if [ -z "$LOG_LOCATION" ]; then
14 echo "WARNING: Unable to determine log location. Logs will not be uploaded"
17 sudo chmod 777 ${LOG_LOCATION}
18 UPLOAD_LOCATION="${GS_URL}/logs/${JOB_NAME}/${BUILD_NUMBER}/"
19 gsutil -m cp -r ${LOG_LOCATION} gs://${UPLOAD_LOCATION} > gsutil.latest_logs.log
20 echo -e "Logs available at: \n$(find ${LOG_LOCATION} -type f | sed -n 's#^/tmp/#http://'$UPLOAD_LOCATION'#p')"
23 echo "WARNING: Log retrieval failed. No logs will be uploaded"