4

Is there an easy way to remove all the previous pipelines runned in Gitlab?

enter image description here

I would like to clean up this section, but didn't find any options through the interface.

Thanks a lot.

1 Answer 1

7

You can only delete individual pipelines one by one in the UI.

To do bulk deletions, you can use the pipelines API to programmatically list and delete pipelines.

In Python (with the python-gitlab library) it might look something like this:

import gitlab
project_id = 1234
gl = gitlab.Gitlab('https://gitlab.example.com', private_token='My token')
project = gl.projects.get(project_id)
for pipeline in project.pipelines.list(as_list=False):
    pipeline.delete()
1
  • 1
    I don't get why GitLab is not creating a cron schedule option to remove old pipelines.
    – FreshMike
    Feb 20 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.