summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-04-06 10:59:51 -0400
committerTim Rozet <trozet@redhat.com>2018-04-06 10:59:51 -0400
commit4245bad84c1b0ff6b8439d41c17b2740439dbd91 (patch)
treedb5b27e00bd35b4630c14347f50e2c20ffeadd8c
parent2913820a65ed1201c616c188a1af99eb53a9994c (diff)
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 <trozet@redhat.com>
-rwxr-xr-xjjb/apex/apex-fetch-logs.sh5
1 files changed, 3 insertions, 2 deletions
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"