Automatically Deploy Docker Containers on AWS ECS Using Jenkins or Job Scheduler

We are currently creating our Docker containers and publishing them on Amazon ECR. We created TaskDefinitions and can deploy them manually in the ECS cluster. Thus, the new deployment includes a manual update of TaskDefinition.

Now we would like to automate the deployment, so when the Docker image is successfully created using Jenkins and published to the ECR repository, we would like to replace the current current version with the new one.

In addition, we would like to give people the opportunity to launch a specific version of 1 or more docker container combinations. Any suggestion on how we can implement a continuous loop without manually updating TaskDefinitions?

+4
source share
2 answers

This article describes how to do continuous deployments in ECS with Jenkins. It uses a shell script after the image has been built and clicked to update ECS with a new version of the task definition. Hope it helps.

+4
source

A simpler solution for this would be to use an ecs-deploy script from here:

https://github.com/silinternational/ecs-deploy

After my container was built and deployed on dockerhub, this is just a question:

ecs-deploy -k $AWS_KEY -s $AWS_SECRET -r $AWS_REGION -c $CLUSTER_NAME -n $SERVICE_NAME -i $DOCKER_IMAGE_NAME

and it does.

+7
source

Source: https://habr.com/ru/post/1628136/


All Articles