Skip to content

Commit

Permalink
Bug 1832287 - support "buildhub-only" value for aws bucket config (#983)
Browse files Browse the repository at this point in the history
The only thing we still need to upload to the s3
net-mozaws-{stage,prod}-delivery-* buckets is buildhub.json; until buildhub is
updated to not need that, skip uploading everything else.
  • Loading branch information
jcristau authored Apr 30, 2024
1 parent 3be3ba1 commit 8ebd9a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions beetmoverscript/docker.d/worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ clouds:
'COT_PRODUCT == "firefox" && (ENV == "dev" || ENV == "fake-prod")':
dep:
fail_task_on_error: True
enabled: True
enabled: buildhub-only
credentials:
id: { "$eval": "DEP_ID" }
key: { "$eval": "DEP_KEY" }
Expand Down Expand Up @@ -260,7 +260,7 @@ clouds:
'COT_PRODUCT == "firefox" && ENV == "prod"':
nightly:
fail_task_on_error: True
enabled: True
enabled: buildhub-only
credentials:
id: { "$eval": "NIGHTLY_ID" }
key: { "$eval": "NIGHTLY_KEY" }
Expand All @@ -271,7 +271,7 @@ clouds:
focus: 'net-mozaws-prod-delivery-archive'
release:
fail_task_on_error: True
enabled: True
enabled: buildhub-only
credentials:
id: { "$eval": "RELEASE_ID" }
key: { "$eval": "RELEASE_KEY" }
Expand Down Expand Up @@ -321,7 +321,7 @@ clouds:
'COT_PRODUCT == "thunderbird" && (ENV == "dev" || ENV == "fake-prod")':
dep:
fail_task_on_error: True
enabled: True
enabled: buildhub-only
credentials:
id: { "$eval": "DEP_ID" }
key: { "$eval": "DEP_KEY" }
Expand All @@ -331,15 +331,15 @@ clouds:
'COT_PRODUCT == "thunderbird" && ENV == "prod"':
nightly:
fail_task_on_error: True
enabled: True
enabled: buildhub-only
credentials:
id: { "$eval": "NIGHTLY_ID" }
key: { "$eval": "NIGHTLY_KEY" }
product_buckets:
thunderbird: 'net-mozaws-prod-delivery-archive'
release:
fail_task_on_error: True
enabled: True
enabled: buildhub-only
credentials:
id: { "$eval": "RELEASE_ID" }
key: { "$eval": "RELEASE_KEY" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
"enum": [true, false, "buildhub-only"]
},
"credentials": {
"type": ["object", "string"],
Expand Down
7 changes: 4 additions & 3 deletions beetmoverscript/src/beetmoverscript/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async def push_to_partner(context):

async def push_to_releases(context):
# S3 upload
if context.config["clouds"]["aws"][context.resource]["enabled"]:
if context.config["clouds"]["aws"][context.resource]["enabled"] is True:
await push_to_releases_s3(context)

# GCS upload
Expand Down Expand Up @@ -498,7 +498,7 @@ async def move_partner_beets(context, manifest):
destination = get_destination_for_partner_repack_path(context, manifest, full_path_artifact, locale)

# S3 upload
if context.config["clouds"]["aws"][context.resource]["enabled"]:
if context.config["clouds"]["aws"][context.resource]["enabled"] is True:
cloud_uploads["aws"].append(asyncio.ensure_future(upload_to_s3(context=context, s3_key=destination, path=source)))

# GCS upload
Expand Down Expand Up @@ -656,7 +656,8 @@ async def retry_upload(context, destinations, path):
# we don't have that use case right now, but might be worth fixing
for dest in destinations:
# S3 upload
if is_cloud_enabled(context.config, "aws", context.resource):
enabled = is_cloud_enabled(context.config, "aws", context.resource)
if enabled is True or (enabled == "buildhub-only" and path.endswith("buildhub.json")):
cloud_uploads["aws"].append(asyncio.ensure_future(upload_to_s3(context=context, s3_key=dest, path=path)))

# GCS upload
Expand Down

0 comments on commit 8ebd9a0

Please sign in to comment.