Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dnwe/3fdbddd52a9c9dc8efdb4dad3a740a03 to your computer and use it in GitHub Desktop.
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
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
@mzavody
Copy link

mzavody commented Dec 19, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment