Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to roll back ecs deploy

venkatp
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 8, 2023

Hi Team,

I'm using aws ecr Atlassian pipe for build and push the image to ecr repo. And using aws ecs deploy Atlassian pipe for deploying the ecs, but my doubt is how to rollback to old image?

Please suggest or share the bitbucketpipeline.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2023

Hi @venkatp and welcome to the community!

First, you need to find the Pipelines build that pushed the old version of the image (the one that you want to roll back to).

If the step that pushes the image is a deployment step, there will be an option Redeploy next to the step name. You can select that to redeploy the old version of the image. Alternatively, you can select the Deployments page on the Bibtucket repo, select the name of the Deployment environment you use for this step, and you will see a list with all deployments to this environment. If you select the 3 dots next to the older build you want to redeploy, you will see the option Redeploy.

If the step that pushes the image is not a deployment step, then you can rerun the whole pipeline by selecting the Rerun option.

Kind regards,
Theodora

Venkatkp January 7, 2024

Thanks for your answer! I don't see the redeploy option and if I click rerun it's building new docker image and updating with new not taking old image.

I could see ecr repo old image tag is dot

Please suggest or provide me the pipeline steps Thank you.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2024

Hi Venkat,

If you rerun a pipeline (and also if you run Redeploy for a step) the build is going to execute all the commands again.

Are you rerunning an old build (that built the older version of the image you want to roll back to) or the latest build?

If you rerun an older build (the build that built an image you want to roll back to and not the newest build), doesn't it push again the older version of the image you wanted to roll back to?

Kind regards,
Theodora

Venkatkp January 8, 2024

Hi Thodora,

 

I want to rollback 1 week ago image.

 

Please suggest me for image versioning along with above issue, because in json file we have mentioned tag name is latest, so how we can manage image version as well thanks in advance.

 

Regards,

Venkat

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2024

Hi Venkat,

I don't know if it is possible to tag older versions of the image that do not have a tag already. I would suggest reaching out to AWS ECR support team or to a forum specific to AWS ECR to ask if this is somehow possible e.g. with AWS CLI.

I found the following blog post regarding rolling back to a previous version of a docker image in AWS ECR, however, this assumes that the older versions were also tagged (so you first need to figure out if and how the previous version can be tagged):

Did you try rerunning the Pipelines build that first pushed this 1 week old image?

Going forward, you may want to push multiple tags with each image, see the example on the pipes page under the text

Pushing multiple tags: my-tag and latest. You have to build images with tags first:

If you push an additional (unique) tag along with the latest, it may be easier to roll back following the blog post I shared.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events