Pass values from Shell script to Workflow script in Jenkins Workflow plugin

119 views
Skip to first unread message

Luis Mago

unread,
Oct 29, 2015, 5:59:52 AM10/29/15
to Jenkins Users
Hi, 
I'm trying out the Jenkins Workflow plugin and I was wondering if there is any way to pass values from a shell script to the workflow script without going through writing them in a file a reading and parsing the file from the workflow script.
I've checking 'env' and 'withEnv' but they both seem to work only in one direction (passing values from workflow script to a shell script in the form of environmental variables.

Basically what I'm trying to achieve is something llke:

sh 'LAST_VERSION="$(git describe --abbrev=0 --tags)"'

and now being able to access the result of $(git describe --abbrev=0 --tags)/the value of LAST_VERSION from the workflow script

Thanks in advance

L

B.Latinville

unread,
Dec 17, 2015, 11:51:00 AM12/17/15
to Jenkins Users

Brian Ray

unread,
Dec 17, 2015, 12:20:29 PM12/17/15
to Jenkins Users
We're using this technique too and I think it's the only hack available for the time being.

JENKINS-26133 may some day yield a more elegant, native way to get results back out to the workflow.
Reply all
Reply to author
Forward
0 new messages