[JIRA] (JENKINS-61740) since pull request #373 it not possible to set docker registry with groovy script

1 view
Skip to first unread message

laurent1.hory@ge.com (JIRA)

unread,
Mar 30, 2020, 6:13:03 AM3/30/20
to jenkinsc...@googlegroups.com
Laurent Hory created an issue
 
Jenkins / Bug JENKINS-61740
since pull request #373 it not possible to set docker registry with groovy script
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2020-03-30 10:12
Environment: Jenkins 2.204.5
Docker Pipeline 1.23
Pipeline 2.6
Pipeline: Declarative 1.6.0
Labels: pipeline
Priority: Major Major
Reporter: Laurent Hory

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?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages