Skip to content

Instantly share code, notes, and snippets.

@spig
Created August 19, 2020 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spig/ab99fac63f12f35dc3da9b2290e962c3 to your computer and use it in GitHub Desktop.
Save spig/ab99fac63f12f35dc3da9b2290e962c3 to your computer and use it in GitHub Desktop.
Remove old projects via the Jenkins API
# Replace JobName with the job name and ProjectName with the project name
for JOB in {246..254}
do curl -u $JENKINS_USER_NAME:$JENKINS_API_TOKEN -X POST http://$JENKINS_SERVER:$JENKINS_PORT/view/ProjectName/job/JobName/$JOB/doDelete
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment