Merge pull request #16622 from ixdy/upload-to-gcs-emptydir

Only try to upload test artifacts if they really exist
pull/6/head
Alex Robinson 2015-10-30 15:35:44 -07:00
commit bc608deed6
1 changed files with 1 additions and 1 deletions

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