elastic-ci-stack-for-aws icon indicating copy to clipboard operation
elastic-ci-stack-for-aws copied to clipboard

Add `ArtifactsBucket` to agent environment hooks

Open jufemaiz opened this issue 6 years ago • 2 comments

Add a new ENV in the agent environment hooks for the elastic-ci-stack-for-aws exposing the configured ArtifactsBucket for use in generating BUILDKITE_ARTIFACT_UPLOAD_DESTINATION (and potentially also looking to set BUILDKITE_S3_DEFAULT_REGION and BUILDKITE_S3_ACL based on the details provided).

For example, agent environment hook:

...
export BUILDKITE_ARTIFACT_BUCKET="${var.ArtifactsBucket}" # or however cloudformation would do it
# export BUILDKITE_S3_DEFAULT_REGION="?" # if added as optional add on configuration
# export BUILDKITE_S3_ACL="privarte" # if added as optional add on configuration
...

Then in a pre-command:

export BUILDKITE_ARTIFACT_UPLOAD_DESTINATION="s3://$BUILDKITE_ARTIFACT_BUCKET/$BUILDKITE_JOB_ID"

Ref:

  • https://github.com/buildkite/elastic-ci-stack-for-aws/pull/52
  • https://github.com/buildkite/elastic-ci-stack-for-aws/issues/403
  • https://github.com/buildkite/elastic-ci-stack-for-aws/pull/607

jufemaiz avatar Oct 04 '19 02:10 jufemaiz

Would a PR be welcome for this?

bradleyayers avatar Apr 12 '21 07:04 bradleyayers

@bradleyayers – yep! Always!

chloeruka avatar Apr 13 '21 06:04 chloeruka