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

docker-build-publish-plugin broken compatibility with token-macro-plugin

      A change was introduced in the docker-build-publish-plugin to enable multiple tags. Tags are delimited by a comma (,).

      The Token macro plugin allows you to adjust values to your requirements, using the comma as an operator. In our environment, we have previously used a subset of the Git revision to tag our Docker images. The Token macro used is as follows:

      ${GIT_REVISION,length=6}

      When building using the docker-build-publish plugin, the following error is returned:

      [docker-build] $ docker build -t example/delivery:${GIT_REVISION .
      
      time="2015-02-27T16:53:52Z" level="fatal" msg="Illegal tag name (${GIT_REVISION): only [A-Za-z0-9_.-] are allowed, minimum 2, maximum 30 in length" 
      

      Can the docker-build-publish plugin be fixed to restore compatibility?

          [JENKINS-27164] docker-build-publish-plugin broken compatibility with token-macro-plugin

          Aren't the variables interpreted before they are put on the command line? I bet the comma splitting is being done before the variables (GIT_REVISION) was being interpreted.

          Christian Höltje added a comment - Aren't the variables interpreted before they are put on the command line? I bet the comma splitting is being done before the variables (GIT_REVISION) was being interpreted.

          Michael Neale added a comment -

          yes it could be the order in which the macros are expanded, which means it should be easy to fix.

          Michael Neale added a comment - yes it could be the order in which the macros are expanded, which means it should be easy to fix.

          Code changed in jenkins
          User: Michael Neale
          Path:
          src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java
          http://jenkins-ci.org/commit/docker-build-publish-plugin/44bf30f1468af3e2a5ace3a7a03d95dcf65949fd
          Log:
          Fix for JENKINS-27164. Token expand before tag splitting

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Neale Path: src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java http://jenkins-ci.org/commit/docker-build-publish-plugin/44bf30f1468af3e2a5ace3a7a03d95dcf65949fd Log: Fix for JENKINS-27164 . Token expand before tag splitting

          Michael Neale added a comment -

          Fixed in 0.12 which should be in a maven repo near you shortly.

          Thanks for spotting this and also diagnosing what was the cause - made the fix easy.

          Michael Neale added a comment - Fixed in 0.12 which should be in a maven repo near you shortly. Thanks for spotting this and also diagnosing what was the cause - made the fix easy.

            michaelneale Michael Neale
            justingood Justin Good
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: