Add --dest-bucket to chromite/scripts/pushimage.py
Add flag so that dest bucket can be set to chromeos-throwaway-bucket,
so that we can get new release builders running without actually
modifying our production bucket (chromeos-releases).
Also, Use this flag in the PushImage Build API endpoint.
BUG=chromium:1159569
TEST=run_tests
Cq-Depend: chromium:2599476
Change-Id: I594502a111adc0ba65a4683a9695afcd44c9d93c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2599290
Reviewed-by: George Engelbrecht <engeg@google.com>
Commit-Queue: Jack Neus <jackneus@google.com>
Tested-by: Jack Neus <jackneus@google.com>
diff --git a/api/controller/image.py b/api/controller/image.py
index b7968e9..0a75bad 100644
--- a/api/controller/image.py
+++ b/api/controller/image.py
@@ -303,13 +303,18 @@
if config.validate_only:
return controller.RETURN_CODE_VALID_INPUT
+ kwargs = {}
+ if input_proto.profile.name:
+ kwargs['profile'] = input_proto.profile.name
+ if input_proto.dest_bucket:
+ kwargs['dest_bucket'] = input_proto.dest_bucket
try:
pushimage.PushImage(
input_proto.gs_image_dir,
input_proto.sysroot.build_target.name,
dry_run=input_proto.dryrun,
- profile=input_proto.profile.name,
- sign_types=sign_types)
+ sign_types=sign_types,
+ **kwargs)
return controller.RETURN_CODE_SUCCESS
except Exception:
return controller.RETURN_CODE_COMPLETED_UNSUCCESSFULLY