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

Parameter expansion in Custom Workspace

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      I created a new job and changed the workspace to a custom location by specifying
      a different location. In my case I set the path to:
      /tmp/hudsonBuilds/MyJob/$

      {BUILD_ID}

      Expected Result:
      There will be a directory tree '/tmp/hudsonBuilds/MyJob/yyy-m-dd_hh-mm-ss'
      created to reflect the current $BUILD_ID.

      Current Result:
      There is a directory tree which looks like
      '/tmp/hudsonBuilds/MyJob/${BUILD_ID}

      '. The environment variable doesn't get
      expanded.

      The WORKSPACE environment variable instead has the correct path with expanded
      BUILD_ID variable.

        Attachments

          Issue Links

            Activity

            Hide
            mdonohue mdonohue added a comment -

            Cleaning up bug metadata and simplifying the summary.

            Show
            mdonohue mdonohue added a comment - Cleaning up bug metadata and simplifying the summary.
            Hide
            dlindner dlindner added a comment -

            I'm also interested in this functionality, especially the JOB_NAME

            Show
            dlindner dlindner added a comment - I'm also interested in this functionality, especially the JOB_NAME
            Hide
            dlindner dlindner added a comment -

            Created an attachment (id=951)
            Minimal, but invasive patch for this issue

            Show
            dlindner dlindner added a comment - Created an attachment (id=951) Minimal, but invasive patch for this issue
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: : kohsuke
            Path:
            trunk/hudson/main/core/src/main/java/hudson/model/AbstractBuild.java
            trunk/hudson/main/core/src/main/java/hudson/model/FreeStyleBuild.java
            trunk/hudson/main/test/src/test/java/hudson/model/FreeStyleProjectTest.java
            trunk/www/changelog.html
            http://fisheye4.cenqua.com/changelog/hudson/?cs=22922
            Log:
            [FIXED JENKINS-3997] Custom workspace is now subject to to the variable expansion. This will be in 1.330.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/model/AbstractBuild.java trunk/hudson/main/core/src/main/java/hudson/model/FreeStyleBuild.java trunk/hudson/main/test/src/test/java/hudson/model/FreeStyleProjectTest.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=22922 Log: [FIXED JENKINS-3997] Custom workspace is now subject to to the variable expansion. This will be in 1.330.
            Hide
            jglick Jesse Glick added a comment -

            I guess this change should also solve an exception printed to log when aborting
            a build that was still waiting for a hung polling task:

            Building remotely on ...
            Build was aborted
            Archiving artifacts
            Recording test results
            FATAL: null
            java.lang.NullPointerException
            at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:569)
            at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:111)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
            at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:501)
            at
            hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:487)
            at
            hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:475)
            at hudson.model.Build$RunnerImpl.post2(Build.java:181)
            at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:459)
            at hudson.model.Run.run(Run.java:1143)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:123)

            Show
            jglick Jesse Glick added a comment - I guess this change should also solve an exception printed to log when aborting a build that was still waiting for a hung polling task: Building remotely on ... Build was aborted Archiving artifacts Recording test results FATAL: null java.lang.NullPointerException at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:569) at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:111) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:501) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:487) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:475) at hudson.model.Build$RunnerImpl.post2(Build.java:181) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:459) at hudson.model.Run.run(Run.java:1143) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:123)
            Hide
            jglick Jesse Glick added a comment -
                • Issue 4789 has been marked as a duplicate of this issue. ***
            Show
            jglick Jesse Glick added a comment - Issue 4789 has been marked as a duplicate of this issue. ***

              People

              • Assignee:
                Unassigned
                Reporter:
                irichter irichter
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: