-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.204.5
Docker Pipeline 1.23
Pipeline 2.6
Pipeline: Declarative 1.6.0
since pull request https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/373 the GlobalConfig object are removed and the following code not work:
import org.jenkinsci.plugins.pipeline.modeldefinition.config.GlobalConfig; import org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint; import java.util.logging.Logger; Logger logger = Logger.getLogger("pipeline-api-endpoint"); logger.info("about to add Docker Registry configuration"); GlobalConfig pipelineConfig = GlobalConfig.get(); DockerRegistryEndpoint registryConfig = new DockerRegistryEndpoint("{{ jenkins_docker_registry_host }}:{{ jenkins_docker_registry_port }}", ""); pipelineConfig.setRegistry(registryConfig); pipelineConfig.save(); logger.info("added Docker Registry configuration");
I must downgrade pipeline declarative to 1.5.1 to avoid error in jenkins configuration.
How set docker registry with groovy code without use GlobalConfig please?