Support for implicit variable WORKSPACE in Pipeline stages

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      I've migrated a sequence of build steps to the new Pi Pipeline item in Jenkins ver. 2.0-beta-1. What has worked before (as a part of a Execute Shell build step) does not work now, since I cannot access the Workspace. Simplified example:

      node {
         stage 'Checkout'
         git url: 'git@github.com:abc/sandbox.git'
      
         stage 'Stage 1'
         sh 'echo $WORKSPACE'
         
         stage 'Stage 2'
         sh '''#!/bin/sh
         echo hi
         echo $WORKSPACE'''
      }
      

      In the inline documentation, I read that variable WORKSPACE is not supported currently. On the other hand, looking on the console, the Pipeline job has a workspace where the Git sources were checked out to, according to my first Pipeline stage.

      A workaround could be to have a variable that just holds the current working directory as absolute path, but I do not know the recommended way to get that.

            Assignee:
            Jesse Glick
            Reporter:
            Michael Hüttermann
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: