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

Unable to use ${NODE_NAME} as a Workspace name

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None

      When trying to use ${NODE_NAME} as a value for the workspace name in a Static workspace behavior environment, and running the job the following error will output from the job:

      17:15:16 Building remotely on build117 in workspace c:\trees
      17:15:18 Unable to setup workspace: java.lang.Exception: Undefined workspace: ${NODE_NAME}

      We used this functionality with the other Perforce Plugin as we generally do not lock our jobs to specific machines. We would like to see this behavior exist with the new plugin as well.

          [JENKINS-23718] Unable to use ${NODE_NAME} as a Workspace name

          Paul Allen added a comment -

          I'm still looking into the best implementation for this issue.

          Currently I only support ${...} formatters for template and streams workspaces, but I can understand why you need them for static workspaces.

          That part of change is fairly simple, but I am trying to understand how to access environment vars. I have been experimenting with Parameters builds vars and environment vars, but not sure about their visibility outside of a build (e.g. SCM polling).

          Paul Allen added a comment - I'm still looking into the best implementation for this issue. Currently I only support ${...} formatters for template and streams workspaces, but I can understand why you need them for static workspaces. That part of change is fairly simple, but I am trying to understand how to access environment vars. I have been experimenting with Parameters builds vars and environment vars, but not sure about their visibility outside of a build (e.g. SCM polling).

          Ryan Hummer added a comment -

          Cool, thanks!

          Also a kind of related question. With the other P4 Plugin it has a field for specifying the syntrax for slave agents. We do a lot of Matrix jobs where that field comes into play. I see templates & streams have something like that. Will Static workspaces have something similar? Or should I file a request?

          Thanks!

          Ryan Hummer added a comment - Cool, thanks! Also a kind of related question. With the other P4 Plugin it has a field for specifying the syntrax for slave agents. We do a lot of Matrix jobs where that field comes into play. I see templates & streams have something like that. Will Static workspaces have something similar? Or should I file a request? Thanks!

          Paul Allen added a comment -

          The latest 1.0.6 release should allow access to the NODE_NAME parameter. I also extended the other workspaces to accept the formatting parameters.

          Paul Allen added a comment - The latest 1.0.6 release should allow access to the NODE_NAME parameter. I also extended the other workspaces to accept the formatting parameters.

          Paul Allen added a comment -

          Fixed in 1.0.6

          Paul Allen added a comment - Fixed in 1.0.6

          Ryan Hummer added a comment -

          Works great, thank you!

          Ryan Hummer added a comment - Works great, thank you!

            p4paul Paul Allen
            rhummer Ryan Hummer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: