Jenkins Remove All Builds

Go to Dashboard > Manage Jenkins > Script Console and use the following script to leave just last build import jenkins.model.Jenkins import hudson.model.Job MAX_BUILDS = 1 for (job in Jenkins.instance.items) { println job.name def recent = job.builds.limit(MAX_BUILDS) for (build in job.builds) { if (!recent.contains(build)) { println "Preparing to delete: " + build build.delete() } } }

December 1, 2022 · 1 min · Dmitry Golovach

Jenkins Installation

Jenkins - The open-source automation server with hundreds of plugins to support building, deploying, and automating any project. Pull Jenkins Docker image docker pull jenkins/jenkins Run docker detached with restart option with default port binding 8080:8080 container name my-jenkins image name “jenkins/jenkins” docker run -d --restart unless-stopped -p 8080:8080 --name my-jenkins jenkins/jenkins Check the initial password from the container log: docker logs my-jenkins ************************************************************* ************************************************************* ************************************************************* Jenkins initial setup is required....

November 25, 2022 · 1 min · Dmitry Golovach