Does the sh pipeline step not work in windows with cygwin?

1,530 views
Skip to first unread message

Jonathan Hodgson

unread,
Jul 2, 2016, 3:37:21 PM7/2/16
to Jenkins Users
Hi,

I have cygwin installed (and the cygpath plugin), and the slave seems to find it, but it can't find the script that I assume is first generated by the jenkins slave before calling sh.

[C:\Jenkins\workspace\pipeline-test] Running shell script
sh: C:\Jenkins\workspace\pipeline-test@tmp\durable-313cd6e7\script.sh: command not found

Is this something that anybody has working?


Slide

unread,
Jul 2, 2016, 6:50:38 PM7/2/16
to Jenkins Users
Did you specify the path to sh on the file system in the shell area in the global configuration?

--
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/6ca18674-19a0-4681-ba28-64ed9f24a7b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Hodgson

unread,
Jul 2, 2016, 8:32:34 PM7/2/16
to Jenkins Users
No, it's in my path though. And from what I can see it finds cygwin ok, it's the generated shel script it doesn't find.

I've avoided setting it in the global configuration because it isn't global, my linux and osx machines have different locations for sh compared to the windows one.

Kadrach IsFictious

unread,
Dec 22, 2016, 3:09:10 AM12/22/16
to Jenkins Users
Hi Jonathan,

did you ever resolve this issue? I have the same problem.

Cheers,

Kad

Marcelo Filho

unread,
Feb 6, 2017, 7:31:46 AM2/6/17
to Jenkins Users
Same here, any update? Now I've being blocked by the SSH agent... :(

Dan Tran

unread,
Jun 30, 2017, 4:25:39 AM6/30/17
to Jenkins Users
I am facing same issue where i spin a jnlp slave using cygwin shell, and runs a jenkins pipeline job run inside docker

Here is the error log. The job bails out before spin docker container to build

Running shell script
sh: /cygdrive/c/views/jenkins/workspace/xxxx@tmp/durable-1398ef71/pid: No such file or directory
sh: /cygdrive/c/views/jenkins/workspace/xxxx@tmp/durable-1398ef71/jenkins-log.txt: No such file or directory
sh: /cygdrive/c/views/jenkins/workspace/xxxx@tmp/durable-1398ef71/jenkins-result.txt: No such file or directory


I am on windows 10 with jenkins master as docker container (jenkinsci:LTS).  The slave is on same host using cygwin with access to docker

Thoughts?

-D

Dirk Heinrichs

unread,
Jun 30, 2017, 4:42:25 AM6/30/17
to jenkins...@googlegroups.com
On 30.06.2017 10:25, Dan Tran wrote:

I am facing same issue where i spin a jnlp slave using cygwin shell, and runs a jenkins pipeline job run inside docker

Not sure if that helps, though, but did you try using Windows 10's Ubuntu feature (given your Windows 10 is new enough) instead of Cygwin? Might be more Linux'ish than Cygwin ever was...

HTH...

    Dirk
--
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenTextTM Discovery | Recommind
Email: dirk.he...@recommind.com
Website: www.recommind.de

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Dan Tran

unread,
Jun 30, 2017, 12:33:16 PM6/30/17
to Jenkins Users, dhei...@opentext.com
same issue found on Mingw shell.

Ubuntu shell is promising,  unfortunately I don't see that option under my windows 10 enterprise after turning on 'Developers mode'. I may have been disable by company's central IT

-Dan 

James Nord

unread,
Jul 1, 2017, 6:51:14 AM7/1/17
to Jenkins Users
Any form of Linux emulation on Windows will bring you a world of pain at some point especially inside pipeline.
Even the bash on windows can give you interesting and wonderful results as the jvm launch could be the windows one or the Linux one...

My recommendation is to either
1) just use a Unix agent
2) just call bat (in pipeline) and then get that to call another shell scripts if you need.

Dan Tran

unread,
Jul 1, 2017, 7:25:52 PM7/1/17
to Jenkins Users

I was hoping i can get emulated unix shell on window to bootstrap my JNLP slave which then delegates the rest to Docker via Jenkins Pipeline

-D
Reply all
Reply to author
Forward
0 new messages