• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      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.

          [JENKINS-3997] Parameter expansion in Custom Workspace

          mdonohue added a comment -

          Cleaning up bug metadata and simplifying the summary.

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

          dlindner added a comment -

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

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

          dlindner added a comment -

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

          dlindner added a comment - Created an attachment (id=951) Minimal, but invasive patch for this issue

          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.

          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.

          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)

          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)

          Jesse Glick added a comment -
              • Issue 4789 has been marked as a duplicate of this issue. ***

          Jesse Glick added a comment - Issue 4789 has been marked as a duplicate of this issue. ***

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

              Created:
              Updated:
              Resolved: