Jenkins Task - Is it possible to add a windows shell commands as a step ( on Windows salve) inside a Linux master job.

47 views
Skip to first unread message

Eldad Cohen

unread,
Mar 4, 2016, 8:10:32 AM3/4/16
to Jenkins Users
Hi,

Is it possible to add to a master job that runs on Linux , some windows shell commands step on windows slave inside a Linux master job.
Let's say a , how to run windows commands step on slave when running a job on Linux master.
Hope I am describing my question correct .

Thanks in Advanced on any help

jpd4nt

unread,
Mar 4, 2016, 4:14:36 PM3/4/16
to Jenkins Users
Hi Eldad.

What are you trying to achieve?

Is there any reason you can't run the job on the Windows slave?
32

Eldad Cohen

unread,
Mar 6, 2016, 9:47:03 AM3/6/16
to Jenkins Users
Hi,

Thanks for your response.
I have to connect to a windows slave since My IT have provided for me some management scripts in Power shell.
There is not other option from a Linux machine to do the scripts.
That is the reason I need to run a step from windows slave in my Linux master job,

Thanks

jpd4nt

unread,
Mar 6, 2016, 10:48:10 PM3/6/16
to Jenkins Users
Hi

Either run the job on a windows slave and SSH back to a Linux box to run anything you can't on a windows box

Or try:
https://chocolatey.org/packages/win32-openssh

It's Microsoft powershell team port of openssh

James Nord

unread,
Mar 10, 2016, 7:29:37 PM3/10/16
to Jenkins Users
Yes - use the https://wiki.jenkins-ci.org/display/JENKINS/DistFork+Plugin with appropriate labels.

Or change your job type to pipeline that will allow you to use multiple `node`s

/James

Francois Marot

unread,
Mar 10, 2016, 8:42:06 PM3/10/16
to Jenkins Users
Hi Eldad,

can we try seeing the problem from another perspective ?
Is what you want to achieve something like: 1- run Linux commands 2- run powershell windows commands 3- run again some Linux commands
If yes, then, why don't you split your job into 3 different jobs and chain then ? Chaining can be declared either in a 4th "master" job or through the "post build action", each job telling which one to run next. I personally prefer the former.

Regards

Jakub Gladykowski

unread,
Mar 11, 2016, 11:27:53 AM3/11/16
to Jenkins Users
Hi,

While installing GIT, many UNIX commands can be installed and added to path https://git-scm.com/ Then you can execute some shell commands on Windows slave. This is fast approach. Full approach would involve installing CYGWIN or some other stuff.

On Friday, March 4, 2016 at 9:10:32 AM UTC+1, Eldad Cohen wrote:
Reply all
Reply to author
Forward
0 new messages