Hi, 

AFAIK, WORKSPACE is defined per agent, not for a global pipeline. 
For instance, if you run a pipeline on two distincts agents, each of them will 
have its own WORKSPACE 



Xavier Raynaud 
Integration & Release Manager • Kalray 
Phone: +33 6 32 19 22 56 
xrayn...@kalrayinc.com • [ https://www.kalrayinc.com/ | www.kalrayinc.com ] 

[ https://www.kalrayinc.com/ |   ] 

Please consider the environment before printing this e-mail. 
This message contains information that may be privileged or confidential and is 
the property of Kalray S.A. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient, you are not authorized to 
print, retain, copy, disseminate, distribute, or use this message or any part 
thereof. If you receive this message in error, please notify the sender 
immediately and delete all copies of this message. 



From: "Jochen Wiedmann" <jochen.wiedm...@gmail.com> 
To: "Jenkins Users" <jenkinsci-users@googlegroups.com> 
Sent: Wednesday, January 18, 2023 3:00:00 PM 
Subject: Shared Library: Converting a complete pipeline to a single step. 

Hi, 

I have a build job with the following pipeline, which works just fine: 

@Library('isccr-addons')_ 
pipeline { 
agent any 
stages { 
stage ('init') { 
steps { 
isccrExec "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE} 
} 
} 
} 

The "isccrExec" is a step, that's specified in my shared library. 
I expect to have quite a lot of these build jobs. So, I am thinking 
about moving as much code as possible to the shared library. 
I have tried to create a new step "isccrPipeline" with the following 
definition: 

pipeline { 
agent any 
stages { 
stage ('init') { 
steps { 
isccrExec "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE} 
} 
} 
} 

Basically, that's just the same. Now I am trying to use that step with this 
new build pipeline: 

@Library('isccr-addons')_ 
isccrPipeline "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE} 

Unfortunately, that fails with this error message: 

groovy.lang.MissingPropertyException: No such property: WORKSPACE for class: 
groovy.lang.Binding 

Any ideas, what's wrong? 

Thanks, 

Jochen 






-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group. 
To unsubscribe from this group and stop receiving emails from it, send an email 
to [ mailto:jenkinsci-users+unsubscr...@googlegroups.com | 
jenkinsci-users+unsubscr...@googlegroups.com ] . 
To view this discussion on the web visit [ 
https://groups.google.com/d/msgid/jenkinsci-users/09e51da7-e421-44f7-b1c9-d169f9c19fc2n%40googlegroups.com?utm_medium=email&utm_source=footer
 | 
https://groups.google.com/d/msgid/jenkinsci-users/09e51da7-e421-44f7-b1c9-d169f9c19fc2n%40googlegroups.com
 ] . 


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/655303093.2695969.1674051462757.JavaMail.zimbra%40kalray.eu.

Reply via email to