How can we configure gitlab to keep only the last 10 CI jobs/builds and keep deleting the rest?
For example , in Jenkins , we can configure the job to keep only last X builds.
As of Gitlab Release 12.6, deleting a pipeline is now an option in the GUI for owners:
As of Gitlab Release 11.6, deleting a pipeline is now an option, for maintainers only, via the API.
You need:
id
of the projectpipeline_id
of the pipeline you wish to remove.Example using curl from the docs for project id: 1
and pipeline_id: 4
:
curl --header "PRIVATE-TOKEN: <your_access_token>" --request "DELETE" "https://gitlab.example.com/api/v4/projects/1/pipelines/46"
Documentation is here