Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61740

since pull request #373 it is not possible to set docker registry with groovy script

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major 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?

            Unassigned Unassigned
            laurent1 Laurent Hory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: