Remove pipeline directory on agent after completion

25 views
Skip to first unread message

Joel Bodenmann

unread,
Mar 5, 2021, 12:43:23 PM3/5/21
to go-cd
Is there (by now) a feature available that allows to configure either on a per-agent or a per-pipeline level the behavior that a pipeline directory is automatically removed from the agent after finishting the pipeline job (in all cases, not just on success)?

I believe that this older thread is asking for the same: https://groups.google.com/g/go-cd/c/fhlYvVcg5H4


Best regards,
~ Joel

Ashwanth Kumar

unread,
Mar 5, 2021, 9:20:48 PM3/5/21
to go...@googlegroups.com
AFAIK there isn't any feature so far in GoCD. We currently use custom script to delete all the other pipelines on an Agent by running a cleanup pipeline periodically. Since each agent is exclusive to a pipeline run, you can safely delete all the other pipelines in the working directory via the cleanup pipeline without breaking any builds / deployment.

Thanks,
 

--
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/a1f351e5-c717-4153-be6e-7a1cfd77aa2dn%40googlegroups.com.


--

Ashwanth Kumar / ashwanthkumar.in

Jason Smyth

unread,
Mar 6, 2021, 1:07:13 PM3/6/21
to go-cd
Hi Joel,

Like Ashwanth, we also use a custom script to clean up Pipeline working directories. We run ours as a Windows Scheduled Task and leave the 5 most recent working directories. This creates an opportunity for race conditions, though, if the Agent happens to pick up a Job for a Pipeline while the cleanup script is in the middle of deleting that Pipeline's directory.

We haven't run into any issues yet but, if we do, we may have to look at adopting Ashwanth's idea of running cleanup in a dedicated Pipeline.

Cheers,
Jason
Reply all
Reply to author
Forward
0 new messages