From 623cbb5bd6618d0f3e6743a8f5e229a5b594e166 Mon Sep 17 00:00:00 2001 From: Jeff Grafton Date: Fri, 30 Oct 2015 14:51:35 -0700 Subject: [PATCH] Only try to upload artifacts if they really exist. --- hack/jenkins/upload-to-gcs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/jenkins/upload-to-gcs.sh b/hack/jenkins/upload-to-gcs.sh index 9c067b00383..aa937ed2462 100755 --- a/hack/jenkins/upload-to-gcs.sh +++ b/hack/jenkins/upload-to-gcs.sh @@ -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