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

    Details

    • Similar Issues:

      Description

      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?

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: