Build roll back

0

I am using git, code pipeline, code build and code deployment in my CI/CD, whenever change is made in a particular branch pipeline ia triggered and code build build the code and pushes into ECR with latest tag in it and code deploy copies the code from Source(not build) and paste it into ec2 instance after which a bash script pulls the latest docker image and start the container.

Now the issue is when something goes wrong i want to deploy the previous build immediately. Now in my setup this cannot be done as there is no link between docker image and code deployment.

How can I connect docker image with code deployment so whenever I roll back the roll backed docker image is pull and container is created. Or are there any way I can change my pipeline so i could keep my previous build and use it whenever necessary

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions