On Fri, Aug 4, 2023 at 3:03 PM Vijayakumaran A. <
[email protected]> 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)


>
>
>
> On Fri, Aug 4, 2023 at 11:51 AM Chad Wilson <[email protected]>
> wrote:
>
>> 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.
>>
>> https://www.gocd.org/2017/06/20/hotfixes-rollback-rollforward.html may
>> be useful alongside the wider series at
>> https://www.gocd.org/tags/modeling-deployment-pipelines.html
>>
>> -Chad
>>
>> On Fri, 4 Aug 2023, 13:58 Vijayakumaran A., <
>> [email protected]> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/go-cd/933926d9-2ac7-4a34-b994-98a0f9a12c7an%40googlegroups.com
>>> <https://groups.google.com/d/msgid/go-cd/933926d9-2ac7-4a34-b994-98a0f9a12c7an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/go-cd/CAA1RwH-gG18mKgqeUMkSz3NYwoHTe%2BWsb0ckSsB4uiPSt003AQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/go-cd/CAA1RwH-gG18mKgqeUMkSz3NYwoHTe%2BWsb0ckSsB4uiPSt003AQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
>
> [image: Email Signature.png]
>
> *VIJAYAKUMARAN A *
>
> *Technical Operations Engineer *
> +919788372454
>
> *[email protected] <[email protected]>*
>
> http://www.praniontech.com
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/CAMpsvH3y6TXs63JvVQKoS2UTFstU4Z%3DjgATz-cN0DP8HRdGRnQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/go-cd/CAMpsvH3y6TXs63JvVQKoS2UTFstU4Z%3DjgATz-cN0DP8HRdGRnQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CANiY96avMEKnW6WbpkyJBVzi%2BqLuAAu%2BFUy8vvJbrfbAOeia5g%40mail.gmail.com.

Reply via email to