Skip to content

Instantly share code, notes, and snippets.

@mahirrudin
Last active January 9, 2020 22:14
Show Gist options
  • Save mahirrudin/79d95cc961d335c9be30c6ce9efae9c5 to your computer and use it in GitHub Desktop.
Save mahirrudin/79d95cc961d335c9be30c6ce9efae9c5 to your computer and use it in GitHub Desktop.
Shell script for cleaning gitlab
#!/usr/bin/env sh
read -p 'GITLAB-CI-TOKEN: ' token
read -p 'GITLAB-PROJECT-ID: ' projectid
read -p 'PIPELINE-ID-FIRST: ' firtspipeline
read -p 'PIPELINE-ID-LAST: ' lastpipeline
for i in {$firtspipeline..$lastpipeline}; do `curl -k --header "PRIVATE-TOKEN: $token" --request "DELETE" https://gitlab.devsecops.lab/api/v4/projects/$projectid/pipelines/$i`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment