Only try to upload artifacts if they really exist.

This commit is contained in:
Jeff Grafton 2015-10-30 14:51:35 -07:00
parent e46f7e29c4
commit 623cbb5bd6

View File

@ -54,7 +54,7 @@ function upload_logs_to_gcs() {
local -r gcs_acl="public-read"
for upload_attempt in $(seq 3); do
echo "Uploading to ${gcs_build_path} (attempt ${upload_attempt})"
if [[ -d "${artifacts_path}" ]]; then
if [[ -d "${artifacts_path}" && -n $(ls -A "${artifacts_path}") ]]; then
gsutil -m -q -o "GSUtil:use_magicfile=True" cp -a "${gcs_acl}" -r -c \
-z log,txt,xml "${artifacts_path}" "${gcs_build_path}/artifacts" || continue
fi