[build] Make `upload_artifacts` conditional on artifact_gcs_bucket
Currently, the recipe will crash if spec.artifact_gcs_bucket
is unset. We'll respect the field being unset here, for builds
which do not require the feature.
Bug: 37259
Change-Id: Ifd44b3493e44e9d89b30e47d60bb466a8c5a711d
diff --git a/recipes/fuchsia/build.py b/recipes/fuchsia/build.py
index 48ed0c2..d602227 100644
--- a/recipes/fuchsia/build.py
+++ b/recipes/fuchsia/build.py
@@ -282,7 +282,8 @@
# Must be done after testing.shard_requests() is called, because that
# modifies the filesystem images. TODO(garymm,joshuaseaton): once legacy_qemu
# code paths are removed, remove this comment as it will become false.
- api.artifacts.upload('upload artifacts', build)
+ if spec.artifact_gcs_bucket:
+ api.artifacts.upload('upload artifacts', build)
def GenTests(api):