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

System env not available for polled or triggered jobs

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • None
    • Tested on Windows only.

      System env not available for polled or triggered jobs.

      For example the following Workspace name does not get the hostname, but rather "COMPUTERNAME".

      Workspace name: jenkins-${NODE_NAME}-${JOB_NAME}-${COMPUTERNAME}

      If this job is started by polling or by a trigger, the workspace does not use the system environment variable, and when run, the Description is not updated with the last used change.

      When you use Build Now, it does find the env variable, and updates the Description appropriately.

      $ p4 clients -t -e jenkins-master-Job1*
      Client jenkins-master-Job1-COMPUTERNAME 2016/11/16 11:03:00 root C:\Program Files (x86)\Jenkins\workspace\Job1 ''
      Client jenkins-master-Job1-JK-WIND7-DBG 2016/11/16 10:51:12 root C:\Program Files (x86)\Jenkins\workspace\Job1 'Change:15305 '

      This is true for at least Freestyle and Multi-configuration projects.

          [JENKINS-39798] System env not available for polled or triggered jobs

          Joel Kovisto created issue -
          Joel Kovisto made changes -
          Environment New: Tested on Windows only.
          Adil Akhund-Zade made changes -
          Description Original: System env not available for polled or triggered jobs.

          For example the following Workspace name does not get the hostname, but rather "COMPUTERNAME".

          Workspace name: jenkins-${NODE_NAME}-${JOB_NAME}-${COMPUTERNAME}

          If this job is started by polling or by a trigger, the workspace does not use the system environment variable, and when run, the Description is not updated with the last used change.

          When you use Build Now, it does find the env variable, and updates the Description appropriately.

          $ p4 clients -t -e jenkins-master-Job1*
          Client jenkins-master-Job1-COMPUTERNAME 2016/11/16 11:03:00 root C:\Program Files (x86)\Jenkins\workspace\Job1 ''
          Client jenkins-master-Job1-JK-WIND7-DBG 2016/11/16 10:51:12 root C:\Program Files (x86)\Jenkins\workspace\Job1 'Change:15305 '

          This is true for at least Freestyle and Multi-configuration projects.
          New: System env not available for polled or triggered jobs.

          For example the following Workspace name does not get the hostname, but rather "COMPUTERNAME".

          Workspace name: jenkins\-$\{NODE_NAME\}\-$\{JOB_NAME\}\-$\{COMPUTERNAME\}

          If this job is started by polling or by a trigger, the workspace does not use the system environment variable, and when run, the Description is not updated with the last used change.

          When you use Build Now, it does find the env variable, and updates the Description appropriately.

          $ p4 clients -t -e jenkins-master-Job1*
          Client jenkins-master-Job1-COMPUTERNAME 2016/11/16 11:03:00 root C:\Program Files (x86)\Jenkins\workspace\Job1 ''
          Client jenkins-master-Job1-JK-WIND7-DBG 2016/11/16 10:51:12 root C:\Program Files (x86)\Jenkins\workspace\Job1 'Change:15305 '

          This is true for at least Freestyle and Multi-configuration projects.

            Unassigned Unassigned
            jkovisto Joel Kovisto
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: