[JIRA] (JENKINS-41890) Declarative syntax: ${env.WORKSPACE} not set in environment block

3 views
Skip to first unread message

p.garstenauer@sanitas.at (JIRA)

unread,
Feb 9, 2017, 7:45:01 AM2/9/17
to jenkinsc...@googlegroups.com
Paul Garstenauer created an issue
 
Jenkins / Bug JENKINS-41890
Declarative syntax: ${env.WORKSPACE} not set in environment block
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2017/Feb/09 12:44 PM
Environment: Windows
Labels: declarative pipeline
Priority: Minor Minor
Reporter: Paul Garstenauer

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
}
}

....

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Feb 9, 2017, 12:08:03 PM2/9/17
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

andrew.bayer@gmail.com (JIRA)

unread,
Feb 9, 2017, 12:08:03 PM2/9/17
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
Change By: Andrew Bayer
Component/s: pipeline-model-definition-plugin
Component/s: pipeline

andrew.bayer@gmail.com (JIRA)

unread,
Feb 9, 2017, 2:21:02 PM2/9/17
to jenkinsc...@googlegroups.com
Andrew Bayer reopened an issue
 

Reopening - while working on JENKINS-41748, I realized that this will still be a problem there, since we don't actually have a WORKSPACE yet at the time we do environment variable resolution.

Change By: Andrew Bayer
Resolution: Duplicate
Status: Resolved Reopened
Assignee: Andrew Bayer

andrew.bayer@gmail.com (JIRA)

unread,
Feb 9, 2017, 2:50:02 PM2/9/17
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Bug JENKINS-41890
 
Change By: Andrew Bayer
Status: Reopened In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Feb 9, 2017, 2:50:02 PM2/9/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Feb 9, 2017, 2:50:03 PM2/9/17
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-41890
 
Re: Declarative syntax: ${env.WORKSPACE} not set in environment block

PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/110 - decided that this merited a separate commit from JENKINS-41748 but not a separate PR entirely, since it required the JENKINS-41748 change anyway. =)

andrew.bayer@gmail.com (JIRA)

unread,
Mar 13, 2017, 5:33:03 PM3/13/17
to jenkinsc...@googlegroups.com
Change By: Andrew Bayer
Status: In Review Resolved
Resolution: Fixed
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:43 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages