elastic-ci-stack-for-aws
elastic-ci-stack-for-aws copied to clipboard
Add `ArtifactsBucket` to agent environment hooks
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
Would a PR be welcome for this?
@bradleyayers – yep! Always!