We are using below script to deploying the AWS ECS, it's trying to updating ecs service but not updating and it's sitting old revision and ecr latest image also not updating can some one suggest how to deploy aws ecs using bitbucket pipeline.
Mentioned below yml file.
image: python:3.7.4-alpine3.10
pipelines:
tags:
ecr-release-*:
- step:
name: Build and pushing the Docker Image
services:
- docker
caches:
- pip
script:
- pip3 install awscli
- IMAGE="709724358365.dkr.ecr.ap-south-1.amazonaws.com/testrepo"
- TAG=V1.1.05
- aws configure set aws_access_key_id $AWS_ACCESS_KEY
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- aws configure set AWS_DEFAULT_REGION $AWS_REGION
- eval $(aws ecr get-login --no-include-email --region ap-south-1 | sed 's;https://;;g') - docker build -t $IMAGE:$TAG .
- docker push $IMAGE:$TAG
- step:
name: Deploy to ECS
script:
- pipe: atlassian/aws-ecs-deploy:1.8.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_REGION
CLUSTER_NAME: 'myapp-cluster'
SERVICE_NAME: 'testapp-service'
TASK_DEFINITION: 'task-definition.json'
FORCE_NEW_DEPLOYMENT: 'true'