Rollback deployment method

137 views
Skip to first unread message

Vijayakumaran A.

unread,
Aug 4, 2023, 1:58:26 AM8/4/23
to go-cd
Hi Team,

How to rollback to the previous deployment. Please any one share any ideas/Docs to refer.

Chad Wilson

unread,
Aug 4, 2023, 2:20:58 AM8/4/23
to go...@googlegroups.com
It depends on the tooling you are using and what environment/stack you are deploying to, alongside artifact storage relevant to your deployments.

Not all deployments can be rolled back without extra effort in tooling or application design (e.g how will you roll back a DROP TABLE for a database? Do you have rollback scripts that need to be invoked? Do you use DB snapshots pre-deploy?)

GoCD isn't opinionated about this.

If you are using a declarative deployment tool or approach you can sometimes trigger a re-run of the previous successful deployment's pipeline instance/stage. Sometimes teams will roll forward (from a GoCD perspective) by initialising a new pipeline run and populating some environment variable to override the artifact versions to deploy. Or use a manual 'rollback' stage in the same pipeline as the normal deploy.

As with most other pipeline automation approaches, all of these things depend on your target platform, tooling and application design.


-Chad

On Fri, 4 Aug 2023, 13:58 Vijayakumaran A., <vijayak...@praniontech.com> wrote:
Hi Team,

How to rollback to the previous deployment. Please any one share any ideas/Docs to refer.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/933926d9-2ac7-4a34-b994-98a0f9a12c7an%40googlegroups.com.

Vijayakumaran A.

unread,
Aug 4, 2023, 3:03:29 AM8/4/23
to go...@googlegroups.com
hi Thanks for the reply,actually we are new to gocd and we have simple two  pipelines as of now.

pipeline one for java application with two stages:

Stage 1 : build stage using maven 
Stage 2 : copy the build war file to tomcat directory. (cp *.war /opt/tomcat/webapp)

Another pipeline for php whenever developers push their code gocd automatically triggered in this pipeline we have only one stage.

stage: cd /path/to/phpdirectory && git pull 

When I use trigger with option to run the pipeline with specific commit it only runs that commit changes in go-agent home path /usr/share/go-agent/lib/pipelines/pipelinename not in /path/to/phpdirectory

Please help us to rollback the method for the above scenario.



You received this message because you are subscribed to a topic in the Google Groups "go-cd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/go-cd/eqYdAKivhi0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH-gG18mKgqeUMkSz3NYwoHTe%2BWsb0ckSsB4uiPSt003AQ%40mail.gmail.com.


--

Email Signature.png

VIJAYAKUMARAN A

Technical Operations Engineer 

vijayakumaran.a@praniontech.com

http://www.praniontech.com


Sriram Narayanan

unread,
Aug 5, 2023, 12:18:52 PM8/5/23
to go...@googlegroups.com
On Fri, Aug 4, 2023 at 3:03 PM Vijayakumaran A. <vijayak...@praniontech.com> wrote:
hi Thanks for the reply,actually we are new to gocd and we have simple two  pipelines as of now.

pipeline one for java application with two stages:

Stage 1 : build stage using maven 
Stage 2 : copy the build war file to tomcat directory. (cp *.war /opt/tomcat/webapp)

Another pipeline for php whenever developers push their code gocd automatically triggered in this pipeline we have only one stage.

stage: cd /path/to/phpdirectory && git pull 

When I use trigger with option to run the pipeline with specific commit it only runs that commit changes in go-agent home path /usr/share/go-agent/lib/pipelines/pipelinename not in /path/to/phpdirectory

Please help us to rollback the method for the above scenario.

Assuming that you need help with just the PHP scenario, please see if the following meets your needs:
Just as you are using "cp" to copy the war file to /opt/tomcat/webapp, you could similarly run a shell script for your PHP deployment scenario to perform the following action:
a. cp the files from the current directory (/usr/share/go-agent/lib/pipelines/pipelinename) to /path/to/phpdirectory
b. Change the ownership of /path/to/phpdirectory to the user of the web server ( the "go" user will need to sudo privileges with NOPASSWD, or at least NOPASSWD for this particular script/chown)
 

Vijayakumaran A.

unread,
Aug 9, 2023, 2:49:50 AM8/9/23
to go-cd
Thanks,So i don't want to git pull stage inside of i need to cp stage for copying all files/folders from go-agent  directory (/usr/share/go-agent/lib/pipelines/pipeline name) to /path/to/phpdirectory.my php project have huge size , it means i need to have a twice storage. 
Reply all
Reply to author
Forward
0 new messages