I would like to send arguments when I call an anchor with bitbucket pipelines
Here is the file I am using, I have to call after-script
because I need to push to a certain S3 bucket
definitions:
steps:
- step: &node-build
name: Build React app
image: node:lts-alpine
script:
- npm install --no-optional
- npm run build
artifacts:
- build/**
- step: &aws-ecr-s3
name: AWS S3 deployment
image: amazon/aws-cli
script:
- aws configure set aws_access_key_id "${AWS_KEY}"
- aws configure set aws_secret_access_key "${AWS_SECRET}"
pipelines:
branches:
master:
- step: *node-build
- step:
<<: *aws-ecr-s3
after-script:
- aws s3 cp ./build s3://my-app-site-dev --recursive
staging:
- step: *node-build
- step:
<<: *aws-ecr-s3
after-script:
- aws s3 cp ./build s3://my-app-site-uat --recursive
I am trying to do something like the following to not have to use that after-script
part
definitions:
steps:
- step: &node-build
name: Build React app
image: node:lts-alpine
script:
- npm install --no-optional
- npm run build
artifacts:
- build/**
- step: &aws-ecr-s3 $FIRST-ARGUMENT
name: AWS S3 deployment
image: amazon/aws-cli
script:
- aws configure set aws_access_key_id "${AWS_KEY}"
- aws configure set aws_secret_access_key "${AWS_SECRET}"
- aws s3 cp ./build s3://${FIRST-ARGUMENT} --recursive
pipelines:
branches:
master:
- step: *node-build
- step: *aws-ecr-s3 my-app-site-dev
staging:
- step: *node-build
- step: *aws-ecr-s3 my-app-site-uat