Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Override/Add S3_BUCKET variable via anchors

Nenad Domuz March 9, 2020

I have multiple buckets defined which are targeted based on the branch I'm using. I have defined an anchored step like so:

- step: &bucket-upload
name: Upload to S3
deployment: test
script:
- pipe: atlassian/aws-s3-deploy:0.4.0
variables:
AWS_ACCESS_KEY_ID: $AWS_DEV_ACCESS_KEY
AWS_SECRET_ACCESS_KEY: $AWS_DEV_SECRET
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: 'one-of-the-buckets'
LOCAL_PATH: 'client/dist/client'
ACL: 'public-read'
DELETE_FLAG: 'true'

Is there any non-hack way to override the variable  when defining the pipeline? I've tried before and nothing happens, even tried ommiting the variable completely.

e.g.

pipelines:
branches:
develop:
- step:
<<: *bucket-upload
deployment: test
S3_BUCKET: 'dev-bucket'
master:
- step:
<<: *bucket-upload
deployment: prod
S3_BUCKET: 'master-bucket'

 

1 answer

0 votes
Abryan Manalansang August 20, 2020

@Nenad Domuz -  I have same concern. I want to reuse codedeploy pipe and override the DEPLOYMENT_GROUP variable.

 master:
- step: *build
- step:
<<: *deploy
name: Deploy to Prod
deployment: production
trigger: manual
script:
variables:
DEPLOYMENT_GROUP: 'production-deployment-group'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events