aspect-build / rules_aws

EXPERIMENTAL: Bazel Integration for Amazon Web Services
Other
10 stars 1 forks source link

feat: Add prefix attribute to s3_sync rule #66

Closed hashken closed 6 months ago

hashken commented 6 months ago

Changes are visible to end-users: yes

Add option prefix to s3_sync rule to copy files to a specific prefix in the bucket.

Test plan

bazel run examples/release_to_s3 resulted in a file in the expected bucket. Note: While testing, updated the bucket name in examples/release_to_s3/BUILD to a bucket where I have access.

CLAassistant commented 6 months ago

CLA assistant check
All committers have signed the CLA.

alexeagle commented 6 months ago

I think the issue is actually just documentation, the example didn't show that we meant "bucket plus prefix"

So I don't think we need the complexity of a new attribute or flag.

For example this is what we have in Aspect's monorepo using this feature:

SILO_VEGA_AWS_INSTALL_BUCKET = "aw-install-4430499330980957/0.0.0-PLACEHOLDER"

and


s3.release(
    name = "us_east_1_release",
    bucket = "aspect-artifacts-us-east-1/{{STABLE_SILO_WORKFLOWS_VERSION}}/workflows",
    profile = "root",
    sync_archive = True,
    tags = [],  # not deliverable
    targets = [":workflows_assets"],
)
hashken commented 6 months ago

I think the issue is actually just documentation, the example didn't show that we meant "bucket plus prefix"

So I don't think we need the complexity of a new attribute or flag.

For example this is what we have in Aspect's monorepo using this feature:

SILO_VEGA_AWS_INSTALL_BUCKET = "aw-install-4430499330980957/0.0.0-PLACEHOLDER"

and


s3.release(
    name = "us_east_1_release",
    bucket = "aspect-artifacts-us-east-1/{{STABLE_SILO_WORKFLOWS_VERSION}}/workflows",
    profile = "root",
    sync_archive = True,
    tags = [],  # not deliverable
    targets = [":workflows_assets"],
)

Ouch. That makes sense. Should have caught that 🤦🏽

Closing this PR.

alexeagle commented 6 months ago

I think #67 fixes the missing docs by using a prefix in the example