Skip to content

[JENKINS-3997] Parameter expansion in Custom Workspace #18900

Closed

Description

@jenkins-infra-bot

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.


Originally reported by irichter, imported from: Parameter expansion in Custom Workspace
  • status: Closed
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2009-10-19T11:04:20+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

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.

  • environment: Platform: All, OS: All
1 attachment

Activity

  1. jenkins-infra-bot commented on Jul 8, 2009

    @jenkins-infra-bot
    Author
    mdonohue:
    • Original comment link
    • Raw content of original comment:

      Cleaning up bug metadata and simplifying the summary.

    Cleaning up bug metadata and simplifying the summary.

  2. jenkins-infra-bot commented on Sep 17, 2009

    @jenkins-infra-bot
    Author
    dlindner:
    • Original comment link
    • Raw content of original comment:

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

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

  3. jenkins-infra-bot commented on Oct 15, 2009

    @jenkins-infra-bot
    Author
    dlindner:
    • Original comment link
    • Raw content of original comment:

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

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

  4. jenkins-infra-bot commented on Oct 19, 2009

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original 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.

    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.

  5. jenkins-infra-bot commented on Nov 2, 2009

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original 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)

    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)

  6. jenkins-infra-bot commented on Nov 6, 2009

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:
          • Issue 4789 has been marked as a duplicate of this issue. ***
        • Issue 4789 has been marked as a duplicate of this issue. ***
  7. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-4789]

  8. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-5077]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions