Created
March 19, 2018 14:06
-
-
Save dnwe/3fdbddd52a9c9dc8efdb4dad3a740a03 to your computer and use it in GitHub Desktop.
Jenkins groovy script to remove the "Commit agent's Docker container" setting from all projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.cloudbees.plugins.flow.*; | |
import com.nirima.jenkins.plugins.docker.DockerJobProperty; | |
projects = Jenkins.instance.getAllItems(); | |
projects.each { project -> | |
removed = false | |
project.properties.find{ it.key instanceof com.nirima.jenkins.plugins.docker.DockerJobProperty.DescriptorImpl }.each { property -> | |
project.removeProperty(property.value) | |
removed = true | |
} | |
if (removed) { | |
println project.name | |
project.save() | |
} | |
} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks, this solved my issue with
com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"invalid reference format: repository name must be lowercase"}
than I was facing in jenkins!