Forking a process in Workflow

35 views
Skip to first unread message

Mark Bidewell

unread,
Nov 30, 2015, 8:34:48 PM11/30/15
to Jenkins Users
I am using Workflow to automate the Maven Release Plugin.  Since Maven is not directly supported via workflow, I use the sh step to call Maven.   One of the parameters this plugin takes is the password to use for checkins, however if passwords contain special characters, the "sh" step will fail due to shell interpretations.  I was thinking I could get around this by doing an execute() in workflow but that will only execute on the master.  In workflow, how can I execute a process on a slave without going though a shell?

Thanks

Mark Bidewell

unread,
Dec 3, 2015, 2:36:10 PM12/3/15
to Jenkins Users
In case anyone sees this, I will post my workaround.
1) use writeFile to write the command-line to a file
2) create a script that reads the file, and does a fork-exec using the file contents as a command-line.

Baptiste Mathus

unread,
Dec 4, 2015, 11:41:40 AM12/4/15
to jenkins...@googlegroups.com

Hi,
Did you try to surround your variable with quotes?

Might be a bit tricky sometimes because of the multiple interpolations.
Something like:

sh "mvn blah Dpassword='$password_param' "

HTH

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/37ba6d5f-243c-4bec-97ce-d19d06614b31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages