I need to change ne name of IMAGE dynamically int the task definition. I tried in many ways but without success.
thats my pipe:
- step:
name: Push
image: atlassian/pipelines-awscli
# Pass the Docker service with 7 GB
services:
- docker-7g
oidc: true
# Raise the Step limit from 4 GB to 8 GB.
size: 2x
script:
- TAG=$BITBUCKET_COMMIT
- export AWS_REGION=****
- export AWS_ROLE_ARN=$AWS_ROLE_ARN_1
- export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
- echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token
- IMAGE="**.dkr.ecr.us-east-1.amazonaws.com/am/account-manager:${TAG}" <= IMAGE
- eval $(aws ecr get-login --no-include-email --region us-east-1| sed 's;https://;;g')
- docker build -t $IMAGE .
- docker push $IMAGE
==> this step above works fine. The image is being sent to ECR with BITBUCKET_COMMIT as a TAG
- step:
name: deploy
image: atlassian/default-image:2
services:
- docker
oidc: true
script:
- TAG=$BITBUCKET_COMMIT
- export IMAGE="*****.dkr.ecr.us-east-1.amazonaws.com/am/account-manager:${TAG}"
- envsubst $IMAGE < pipeline/task-definition-template.json > pipeline/task-definition.json
- pipe: atlassian/aws-ecs-deploy:1.6.2
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_OIDC_ROLE_ARN: $AWS_OIDC_ROLE_ARN_1
CLUSTER_NAME: 'am-production-Cluster-GBJBMXmKQYm3'
SERVICE_NAME: 'am-production-account-manager-Service-0lU6qXwcHbOr'
TASK_DEFINITION: 'pipeline/task-definition.json' <= Here is where i need a solution to change the TAG int the parameter IMAGE whit the variable that i created.
services:
- docker
task-definition.json
something esle before .....
],
"image": "", <== <= Here is where i need a solution to change the TAG int the parameter IMAGE whit the variable that i created.
"name": "account-manager"
}
],
.......something esle after.....