From 4245bad84c1b0ff6b8439d41c17b2740439dbd91 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Fri, 6 Apr 2018 10:59:51 -0400 Subject: Apex: fix log uploading Logs were owned by root, so jenkins-ci could not upload them. Also prints exact links for each file so it is easier to directly view logs from jenkins output. Change-Id: I919bf38c87561a696ae96683c56ad5f96c8d795e Signed-off-by: Tim Rozet --- jjb/apex/apex-fetch-logs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'jjb/apex') diff --git a/jjb/apex/apex-fetch-logs.sh b/jjb/apex/apex-fetch-logs.sh index f25f456b1..bdb2252b3 100755 --- a/jjb/apex/apex-fetch-logs.sh +++ b/jjb/apex/apex-fetch-logs.sh @@ -14,9 +14,10 @@ if sudo opnfv-pyutil --fetch-logs; then echo "WARNING: Unable to determine log location. Logs will not be uploaded" exit 0 else + sudo chmod 777 ${LOG_LOCATION} UPLOAD_LOCATION="${GS_URL}/logs/${JOB_NAME}/${BUILD_NUMBER}/" - gsutil cp -r ${LOG_LOCATION} gs://${UPLOAD_LOCATION} > gsutil.latest_logs.log - echo "Logs available at https://${UPLOAD_LOCATION}/$(basename $LOG_LOCATION)" + gsutil -m cp -r ${LOG_LOCATION} gs://${UPLOAD_LOCATION} > gsutil.latest_logs.log + echo -e "Logs available at: \n$(find ${LOG_LOCATION} -type f | sed -n 's#^/tmp/#http://'$UPLOAD_LOCATION'#p')" fi else echo "WARNING: Log retrieval failed. No logs will be uploaded" -- cgit 1.2.3-korg