gitlabgitlab-cicicd

Is there a way to remove old pipelines every 15th day in Gitlab?


Is there a way to schedule removing of old pipelines created every 15th day in gitlab?


Solution

  • There is no feature to expire pipelines periodically/automatically, but you can use scheduled pipelines to run a job on a schedule. You can use that to schedule a job which cleans up pipelines in the project (or other projects).

    You would have to write a script that implements the logic according to your rules. You can script against the pipelines API to get the age of a pipeline as well as delete it when it meets your criteria.