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

Declarative syntax: ${env.WORKSPACE} not set in environment block

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Pipeline - December

      Description

      I got the following in my jenkins file:

      pipeline {
      agent any

      environment {
      SOURCE = "${env.WORKSPACE}
      mydirectory"
      // The above is not working? WORKSPACE is null as you can see later.
      HTDOCS = "C:\\Apache24\\htdocs
      "
      }

      stages {
      stage('Prepare') {
      steps {
      echo "WORKSPACE ${env.WORKSPACE}" // correct
      echo "SOURCE ${env.SOURCE}" // wrong, is set to null\myDirectoy
      echo "INEW_HTDOCS ${env.INEW_HTDOCS}" // correct
      }
      }

      ....

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abayer Andrew Bayer
              Reporter:
              p_garstenauer Paul Garstenauer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: