Skip to content

Commit ce474e9

Browse files
Merge pull request #372 from pietroalbini/ecs-rollback
infra: add documentation on rolling back ecs services
2 parents 36f9e35 + cf774c6 commit ce474e9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/infra/docs/ecs-services.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ pushing any new code beforehand. To do so, run this command:
3636
aws ecs update-service --cluster rust-ecs-prod --service <service-name> --force-new-deployment
3737
```
3838

39+
## Rolling back a deployment
40+
41+
To rollback a bad deployment you can run the [`aws-rollback.py`] script (stored
42+
in the simpleinfra repository) with your [AWS credentials][aws-access] present
43+
in the shell. The script requires the name of the ECR container image
44+
repository as its first and only argument:
45+
46+
```
47+
./aws-rollback.py <image-repository-name>
48+
```
49+
50+
The script will show the list of images available in the repository, and asks
51+
for the image number to rollback to. Once that's inserted the script will point
52+
the `latest` tag to the image you chose, and if an ECS service with the same
53+
name as the repository exists that service will be restarted too.
54+
3955
## Deploying application changes
4056

4157
Each application stores its own Docker container in a [ECR repository][ecr] in
@@ -98,3 +114,4 @@ pushed there will be deployed to the ECS cluster.
98114
[aws-access]: aws-access.md
99115
[console-access]: aws-access.md#using-the-aws-console
100116
[ecr]: https://aws.amazon.com/ecr/
117+
[`aws-rollback.py`]: https://github.com/rust-lang/simpleinfra/blob/master/aws-rollback.py

0 commit comments

Comments
 (0)