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

$WORKSPACE has stopped working in ScriptTrigger shell script

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • scripttrigger-plugin
    • None
    • Jenkins 1.624

      I have jobs that monitor the status of external projects. These look for the latest version, and compare it to a known version. The known version is tracked in a file in the workspace.

      Unfortunately, sometime between July 11 (the last successful build) and August 9 (when I noticed it didn't work) the $WORKSPACE variable has stopped being available in the environment when the ScriptTrigger script is run. This ends up meaning my jobs are now looking in the wrong place. Since looking in the wrong place wound up exiting non-zero, the result was "don't run", which meant I didn't notice something was wrong until the team noticed that an external project had been updated and our Jenkins jobs didn't trigger.

      I'm able to use a combination of

      '$JENKINS_HOME/workspace/$JOB_NAME'

      to re-create the path, but that's a lot less clear, contains a hard-coded value, and I'd rather not have to update dozens of jobs manually.

      If this was changed on purpose, can you explain why, or link to documentation that explains it? I wasn't able to determine.

            gbois Gregory Boissinot
            tcollege Tim College
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: