Need info in gocd pipeline setting for time gap

14 views
Skip to first unread message

s.saw...@gmail.com

unread,
Sep 1, 2021, 2:02:30 AM9/1/21
to go-cd
Hi All,

i want to give some 1 hour time gap between 2 pipelines/stages. can this be possible without using sleep as i do not want my agent to engage for this time duration.

Ashwanth Kumar

unread,
Sep 1, 2021, 2:40:54 AM9/1/21
to go...@googlegroups.com
You can't do that across stages in a single pipeline but you might be able to do it across pipelines. I'm going to assume pipeline A is the first pipeline and you want pipeline B to run 2 hours after A has finished. 

Here are some possible scenarios:
1. Pipeline A runs on a schedule
If yes, then you can set the pipeline B to run roughly 2 hours after A. 

2. Pipeline A runs on changes/manually triggered
If yes, then you can have a stage at the end of pipeline that could generate a cron schedule and update the pipeline B with it. It's not nice I know. 

3. Option 3
If you want to run pipeline B to run after a few hours / minutes because of an external event, see if you can have that event source trigger pipeline B via GoCD API. I don't know if this might fit your use-case but just putting it out there.

4. Custom SCM Plugin
Another fancy way would be to write a custom new SCM plugin that does these for you. Depending on how much you want to do this in your infrastructure, you can choose to invest in something like that.

Having said that, I would really like to understand your use-case if it's okay to share on why you would need something like that? 

On Wed, Sep 1, 2021, 11:32 AM s.saw...@gmail.com <s.saw...@gmail.com> wrote:
Hi All,

i want to give some 1 hour time gap between 2 pipelines/stages. can this be possible without using sleep as i do not want my agent to engage for this time duration.

--
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/4f23bf57-027c-4913-b73e-3174cfeef0f3n%40googlegroups.com.

Sunaina Awadhiya

unread,
Sep 1, 2021, 3:33:08 AM9/1/21
to go...@googlegroups.com
Hi Ashwanth,

Thank you for response. Below is my Usecase:

1. Pipeline A trigger some task which takes time to complete(say 1 hour)
2. Pipeline B have verification steps for pipeline A which needs to wait for 1 hour

I can have some other way like using AWS lambda but this is the easiest way what i could see. 




--
Sunaina Awadhiya
Bangalore

Ashwanth Kumar

unread,
Sep 1, 2021, 3:38:03 AM9/1/21
to go...@googlegroups.com
So if task A takes about an hour. Wouldn't you want the pipeline to wait until it completes? That way you know the status of the task isn't? We also use GoCD as a workflow scheduler and realised over the years that waiting for the task makes sure we get both history (runtime graph, success /failure etc.) and better visibility from GoCD for free. 

Do you think something like this would work? If yes, given your agents are mostly going to be idle you can increase the number of agents to accommodate other pipelines as needed or tie them to a specific resource / environment so you just reuse a small section of them for these long waiting tasks. 

Reply all
Reply to author
Forward
0 new messages