Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker service update detect automatic rollback

I use Gitlab CI/CD to deploy new images to staging server when I make a new commit. In my pipeline the essential part is

docker service update my_service --update-failure-action rollback --image my_image:latest

Sometime the deployment fails then the automatic rollback kicks in. However docker service update always returns 0, so in my pipeline I have no way to know whether the deployment was successful or not.

How can I detect if deployment was really successful / if there was a rollback?

like image 951
Siyu Avatar asked Oct 28 '25 04:10

Siyu


1 Answers

For get update status you can run:

docker service inspect my_service --format "{{.UpdateStatus.State}}"
like image 57
Григорий Бороздин Avatar answered Oct 30 '25 22:10

Григорий Бороздин



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!