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

Evaluate variables and token macros in "Build Context" and "Additional Build Arguments"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 1.642.1
      Token Macro Plugin 1.12.1
      Docker Build and Publish plugin 1.2.1
    • Similar Issues:

      Description

      Environment variables and macro tokens are not expanded in "Build Context" and "Additional Build Arguments".

      It works in other fields like "Repository Name" or "Tag" so I'd expect it to work in other fields too.

      Log output:
      $ docker build --build-arg groupId=$GROUPID --build-arg=artifactId=$ARTIFACTID -t com.corp.product.logic:0.0.3-20160323114446-1623.e3d2d822 --pull=true $WORKSPACE/docker/$GROUPID.$ARTIFACTID

      "com.corp.product.logic:0.0.3-20160323114446-1623.e3d2d822" is evaluated from $GROUPID and $ARTIFACTID entered in fields "Repository Name" and "Tag".

      "--build-arg groupId=$GROUPID --build-arg=artifactId=$ARTIFACTID" is the original value entered in "Additional Build Arguments".

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Wattos
          Path:
          src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java
          http://jenkins-ci.org/commit/docker-build-publish-plugin/8a5c462451f8537eb37ced01a9f46d551803bc70
          Log:
          JENKINS-33745 Fixed unexpanded additional build arguments and context (#40)

          Fix JENKINS-33745

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Wattos Path: src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java http://jenkins-ci.org/commit/docker-build-publish-plugin/8a5c462451f8537eb37ced01a9f46d551803bc70 Log: JENKINS-33745 Fixed unexpanded additional build arguments and context (#40) Fix JENKINS-33745
          Show
          csanchez Carlos Sanchez added a comment - Fixed in https://github.com/jenkinsci/docker-build-publish-plugin/pull/40

            People

            Assignee:
            csanchez Carlos Sanchez
            Reporter:
            jks Julian Kassat
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: