Re: [go-cd] Need help for setup pipeline

48 views
Skip to first unread message
Message has been deleted

Ashwanth Kumar

unread,
Aug 8, 2023, 11:56:55 PM8/8/23
to go...@googlegroups.com
It's hard to debug why it is not reflecting without having the entire pipeline spec or a screenshot of all the tasks that happen. Having said that, based on your note it seems like you're doing `git pull` inside the stage which would defeat the purpose of pipeline materials / tasks. You should instead scp or ftp the contents of the php project to `/var/www/html` folder on the remote server for each run.

Thanks,

On Wed, 9 Aug 2023 at 09:22, Vijayakumaran A. <vijayak...@praniontech.com> wrote:
Hi Team,

I have one requirement, we have a php application,Whenever a developer pushes their code to a repository, gocd automatically triggers the pipeline and deploy the latest code to the php project directory.

example : 
php project dir : /var/ww/html 

Whenever pushes happen my pipeline triggers and deploy the changes to the php project dir.

I have set up one stage with one job 
cd /var/www/html && git pull is working fine.But when i use trigger with option to deploy the previous commit my previous changes are not reflected to my php project directory.

what is the step i need to make this work..im new to gocd please let me know if i did any mistake or need to change anything.

--
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/cbd2d65b-8371-43e9-bf35-10c5482dc682n%40googlegroups.com.


--

Ashwanth Kumar / ashwanthkumar.in

Message has been deleted

Vijayakumaran A.

unread,
Aug 9, 2023, 12:17:37 AM8/9/23
to go-cd
My php project has a huge size.material checked in go-agent home path(/usr/share/go-agent/).so everytime pipeline run we need to copy all my files/folder from go-agent home path(/usr/share/go-agent/lib/pipelines/pipeline name )  to my project directory (var/www/html).is this correct approach ? but does it need more storage.
On Wednesday, August 9, 2023 at 9:40:15 AM UTC+5:30 Vijayakumaran A. wrote:
Hi thanks for the response,Here i have attached my pipeline code.
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/xHSb78j0yeM/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/CAD9m7CzShfqy5GN9XXD0hSmw4Yh7FFZraOM1MXu-CBXqJNE95g%40mail.gmail.com.


--

Email Signature.png

VIJAYAKUMARAN A

Technical Operations Engineer 

vijayakumaran.a@praniontech.com

http://www.praniontech.com


Ashwanth Kumar

unread,
Aug 9, 2023, 12:42:48 AM8/9/23
to go...@googlegroups.com
So just to confirm, you're running go-agent on the same machine where your server is running? If yes (which seems to be the case based on the YAML file), then the answer to your question is also "Yes". 

You need to copy the same set of files over again, it also means it will take twice the space. Today it seems like from your YAML code you're already fetching the artifact for the pipeline so you're already using twice the storage space. 

Thanks,


Vijayakumaran A.

unread,
Aug 9, 2023, 1:08:57 AM8/9/23
to go...@googlegroups.com
Thankyou so much.Yes the given yaml file go server and agent are in same machine.

But I have multiple projects same like this I have another remote machine in that go-agent is running and which have same setup but different meteial.when trigger the pipeline,pipeline start running on this remote machine using resources.In this also ,meterial checkout this machine go-agent path. So  we need to copy that    agent home path project to our php project ? That remote machine also need to have double storage right ? And git pull is wrong method ? 



Ashwanth Kumar

unread,
Aug 9, 2023, 1:19:32 AM8/9/23
to go...@googlegroups.com
Usually "git pull" means you're pulling the latest changes from the server. While for 90% of your case it might be right, but when you're using the "git pull" method you are not leveraging GoCD's power to the full extent. Also why you're not able to roll back the changes when you do "trigger with options" on the deploy pipeline on GoCD. If you still want to use the "git pull" method, you should be doing "git revert <commit>" on the repo directly so every pipeline run will mimic a rollback / roll forward depending on git repo and not based on GoCD. You do not want to do that, just to be clear.

Another point worth mentioning is you don't need to run "go-agent" on the server machine actually. You can have the GoCD server and agents on a separate server and use tools like rsync / ftp / scp to copy the files from the agent to the server location directly. This will also make sure you don't accidentally run different agent when you trigger another pipeline accidentally (which is the behaviour you're seeing). You can circumvent this using "resources" on the agents but it feels like an overkill for your described use-case.

Thanks,



Reply all
Reply to author
Forward
0 new messages