Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2015-05-28 Thread Les Mikesell
On Wed, May 27, 2015 at 1:39 PM, Boris Chavez-Bravo
 wrote:
> I think I have been able to get around this issue by wrapping the call to
> the script through a batch call:
>
> withEnv(["PATH=C:\\cygwin\\bin;%PATH%"]) {
> bat "C:\\cygwin\\bin\\bash ./my_script.sh ${arg1} ${arg2}"
> }
>

I don't mean that cygwin isn't in your path,  I mean that if you
configure jenkins to start your slaves via ssh you don't get the
environment settings passed to it that are configured globally or per
node in jenkins on the slaves that are windows with cygwin ssh.   Most
of our jobs depend on that to find some tools on a UNC path share so
they fail, where the same node connected some other way would work.

-- 
  Les Mikesell
 lesmikes...@gmail.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/CAOAgVpy7m4XwJTt18bjkUcnoG%2BqjMpocokCpgtriRKXafiGJgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2015-05-27 Thread Boris Chavez-Bravo
I think I have been able to get around this issue by wrapping the call to 
the script through a batch call:

withEnv(["PATH=C:\\cygwin\\bin;%PATH%"]) {
bat "C:\\cygwin\\bin\\bash ./my_script.sh ${arg1} ${arg2}"
}


On Wednesday, May 27, 2015 at 1:07:41 PM UTC-4, LesMikesell wrote:
>
> On Thu, Jan 8, 2015 at 12:35 PM, Jesse Glick  > wrote: 
> > On Friday, December 5, 2014 6:35:33 AM UTC-5, Rupali wrote: 
> >> 
> >> So I am concluding that Shell script in in workflow step is not working 
> on 
> >> Windows slave. 
> > 
> > 
> > Or more precisely, that shell scripts run via durable-task-plugin (this 
> also 
> > includes the CloudBees Long-Running Build plugin) do not work on at 
> least 
> > some Cygwin setups. Not surprising, since no one is testing this that I 
> know 
> > of (only use of the ‘bat’ step), so pull requests are welcome. The 
> current 
> > assumption is that ‘sh’ is available somewhere in the path, which 
> apparently 
> > is not true in your case. 
>
> I'd go further and say that not much of anything you expect works on 
> Cygwin setups.  The environment variables that jenkins should export 
> to the slaves don't get set in the cygwin environment. 
>
> -- 
>Les Mikesell 
>  lesmi...@gmail.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/c731e2d7-0b80-4d0c-b3ca-2bbbe13f6ae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2015-05-27 Thread Les Mikesell
On Thu, Jan 8, 2015 at 12:35 PM, Jesse Glick  wrote:
> On Friday, December 5, 2014 6:35:33 AM UTC-5, Rupali wrote:
>>
>> So I am concluding that Shell script in in workflow step is not working on
>> Windows slave.
>
>
> Or more precisely, that shell scripts run via durable-task-plugin (this also
> includes the CloudBees Long-Running Build plugin) do not work on at least
> some Cygwin setups. Not surprising, since no one is testing this that I know
> of (only use of the ‘bat’ step), so pull requests are welcome. The current
> assumption is that ‘sh’ is available somewhere in the path, which apparently
> is not true in your case.

I'd go further and say that not much of anything you expect works on
Cygwin setups.  The environment variables that jenkins should export
to the slaves don't get set in the cygwin environment.

-- 
   Les Mikesell
 lesmikes...@gmail.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/CAOAgVpzoY1atU%2BxGdRGMJswmCfYi%3D27TeHjJdhXqHfyrL5-C%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2015-05-27 Thread Simon Richter
Hi,

On 27.05.2015 17:03, Boris Chavez-Bravo wrote:

> I am facing the exact same issue.  Has anyone come across a solution for 
> this problem?

This smells like one of those cases where you should have been calling
"./script.sh", as the current directory is not on the search path for
very good reasons.

   Simon


-- 
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/5565E51B.1030604%40hogyros.de.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2015-05-27 Thread Boris Chavez-Bravo
I am facing the exact same issue.  Has anyone come across a solution for 
this problem?

On Thursday, January 8, 2015 at 1:35:42 PM UTC-5, Jesse Glick wrote:
>
> On Friday, December 5, 2014 6:35:33 AM UTC-5, Rupali wrote:
>>
>> So I am concluding that Shell script in in *workflow step* is not 
>> working on Windows slave.
>>
>
> Or more precisely, that shell scripts run via durable-task-plugin (this 
> also includes the CloudBees Long-Running Build plugin) do not work on at 
> least some Cygwin setups. Not surprising, since no one is testing this that 
> I know of (only use of the ‘bat’ step), so pull requests are welcome. The 
> current assumption is that ‘sh’ is available somewhere in the path, which 
> apparently is not true in your case.
>

-- 
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/b7714059-f53d-48b5-8d41-af1f063ff08e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2015-01-08 Thread Jesse Glick
On Friday, December 5, 2014 6:35:33 AM UTC-5, Rupali wrote:
>
> So I am concluding that Shell script in in *workflow step* is not working 
> on Windows slave.
>

Or more precisely, that shell scripts run via durable-task-plugin (this 
also includes the CloudBees Long-Running Build plugin) do not work on at 
least some Cygwin setups. Not surprising, since no one is testing this that 
I know of (only use of the ‘bat’ step), so pull requests are welcome. The 
current assumption is that ‘sh’ is available somewhere in the path, which 
apparently is not true in your case.

-- 
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/c9e1917d-abcc-40e6-bb75-9f15c1391513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-05 Thread Rupali
I added a Linux slave today and ran the step to execute shell script on 
Linux slave.
That worked well.
So I am concluding that Shell script in in *workflow step* is not working 
on Windows slave.
Let me know if anyone thinks / knows otherwise.

Regards,
Rupali

On Thursday, December 4, 2014 11:41:48 PM UTC+5:30, LesMikesell wrote:
>
> On Thu, Dec 4, 2014 at 10:47 AM, niraj nandane  > wrote: 
> > See to work all you need to provide bash path in global settings of 
> jenkins 
> > as /bin/bash ..try out this... 
> > 
>
> If a jenkins windows slave is started by cygwin sshd, it doesn't seem 
> to propagate the jenkins variable settings.  Is there a way to work 
> around that? 
>
> -- 
>Les Mikesell 
>  lesmi...@gmail.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/78579dec-d71c-4629-8aa6-3e5483988fb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-04 Thread Les Mikesell
On Thu, Dec 4, 2014 at 10:47 AM, niraj nandane  wrote:
> See to work all you need to provide bash path in global settings of jenkins
> as /bin/bash ..try out this...
>

If a jenkins windows slave is started by cygwin sshd, it doesn't seem
to propagate the jenkins variable settings.  Is there a way to work
around that?

-- 
   Les Mikesell
 lesmikes...@gmail.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/CAOAgVpwquJvVzFa2_svOJ5%2BJoFohGdU_Dikb3pwwP-XfS%3D5Adg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-04 Thread niraj nandane
See to work all you need to provide bash path in global settings of jenkins
as /bin/bash ..try out this...
On Dec 2, 2014 9:20 PM, "Rupali"  wrote:

> To debug further, I modified BourneShellScript.java file in DurableTask
> plugin to print the environment variables with which it is calling the
> script.
> I found that environment variables do not contain path to Cygwin as
> observed in the output.
>
> Can this be reason for the error I am seeing?
> If yes, how to fix that? I have path to Cygwin setup on master and slave
> nodes thorugh which initial execution gets triggered.
>
> Any inputs on this will be highly appreciated.
>
> Regards,
> Rupali
> On Tuesday, December 2, 2014 6:25:57 PM UTC+5:30, Rupali wrote:
>>
>> Hi,
>>
>> I tried number of options but this is not working.
>> Does Shell script in workflow steps works only on Linux/Unix slaves?
>>
>> Regards,
>> Rupali
>>
>> On Monday, December 1, 2014 5:38:50 PM UTC+5:30, Rupali wrote:
>>>
>>> HI Ninad,
>>>
>>> Thank for the reply. But it doesn't work.
>>> Thing is, shell execution works well as part of normal Jenkins job, as a
>>> build step.
>>> But it fails to work when I add it as workflow step.
>>> Not sure if workflow plugin has a different way to invoke shell scripts
>>> than traditional Jenkins shell script execution.
>>>
>>> Regards,
>>> Rupali
>>>
>>> On Friday, November 28, 2014 3:09:05 PM UTC+5:30, Rupali wrote:

 Hi,

 I tried a simple command in shell script as below:
 sh 'echo Hello'

 It gives below error:

 [D:\Jenkins-Slave\workspace\Setup-WF] Running shell script
 cygwin warning:
   MS-DOS style path detected: D:\Jenkins-Slave\workspace\
 Setup-WF\.fb8e6a28\pid
   Preferred POSIX equivalent is: /cygdrive/d/Jenkins-Slave/
 workspace/Setup-WF/.fb8e6a28/pid
   CYGWIN environment variable option "nodosfilewarning" turns off this
 warning.
   Consult the user's guide for more details about POSIX paths:
 http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
 sh: D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\script.sh: command
 not found

 Can you please advise what could be wrong here?

 Regards,
 Rupali

>>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/g0s4kSGQn2I/unsubscribe.
> To unsubscribe from this group and all its topics, 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/08c6d591-fb2c-4303-8474-bbdef892d3a0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALpWO%2BBe5Pyw7251WdRj7b3L-BLhbUbW5p8ZUqg9YURhcBC-qA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-02 Thread Rupali
To debug further, I modified BourneShellScript.java file in DurableTask 
plugin to print the environment variables with which it is calling the 
script.
I found that environment variables do not contain path to Cygwin as 
observed in the output. 

Can this be reason for the error I am seeing?
If yes, how to fix that? I have path to Cygwin setup on master and slave 
nodes thorugh which initial execution gets triggered.

Any inputs on this will be highly appreciated.

Regards,
Rupali
On Tuesday, December 2, 2014 6:25:57 PM UTC+5:30, Rupali wrote:
>
> Hi,
>
> I tried number of options but this is not working.
> Does Shell script in workflow steps works only on Linux/Unix slaves?
>
> Regards,
> Rupali
>
> On Monday, December 1, 2014 5:38:50 PM UTC+5:30, Rupali wrote:
>>
>> HI Ninad,
>>
>> Thank for the reply. But it doesn't work.
>> Thing is, shell execution works well as part of normal Jenkins job, as a 
>> build step.
>> But it fails to work when I add it as workflow step.
>> Not sure if workflow plugin has a different way to invoke shell scripts 
>> than traditional Jenkins shell script execution.
>>
>> Regards,
>> Rupali
>>
>> On Friday, November 28, 2014 3:09:05 PM UTC+5:30, Rupali wrote:
>>>
>>> Hi,
>>>
>>> I tried a simple command in shell script as below:
>>> sh 'echo Hello'
>>>
>>> It gives below error:
>>>
>>> [D:\Jenkins-Slave\workspace\Setup-WF] Running shell script
>>> cygwin warning:
>>>   MS-DOS style path detected: 
>>> D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\pid
>>>   Preferred POSIX equivalent is: 
>>> /cygdrive/d/Jenkins-Slave/workspace/Setup-WF/.fb8e6a28/pid
>>>   CYGWIN environment variable option "nodosfilewarning" turns off this 
>>> warning.
>>>   Consult the user's guide for more details about POSIX paths:
>>> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
>>> sh: D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\script.sh: command not 
>>> found
>>>
>>> Can you please advise what could be wrong here?
>>>
>>> Regards,
>>> Rupali
>>>
>>

-- 
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/08c6d591-fb2c-4303-8474-bbdef892d3a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-02 Thread Rupali
Hi,

I tried number of options but this is not working.
Does Shell script in workflow steps works only on Linux/Unix slaves?

Regards,
Rupali

On Monday, December 1, 2014 5:38:50 PM UTC+5:30, Rupali wrote:
>
> HI Ninad,
>
> Thank for the reply. But it doesn't work.
> Thing is, shell execution works well as part of normal Jenkins job, as a 
> build step.
> But it fails to work when I add it as workflow step.
> Not sure if workflow plugin has a different way to invoke shell scripts 
> than traditional Jenkins shell script execution.
>
> Regards,
> Rupali
>
> On Friday, November 28, 2014 3:09:05 PM UTC+5:30, Rupali wrote:
>>
>> Hi,
>>
>> I tried a simple command in shell script as below:
>> sh 'echo Hello'
>>
>> It gives below error:
>>
>> [D:\Jenkins-Slave\workspace\Setup-WF] Running shell script
>> cygwin warning:
>>   MS-DOS style path detected: 
>> D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\pid
>>   Preferred POSIX equivalent is: 
>> /cygdrive/d/Jenkins-Slave/workspace/Setup-WF/.fb8e6a28/pid
>>   CYGWIN environment variable option "nodosfilewarning" turns off this 
>> warning.
>>   Consult the user's guide for more details about POSIX paths:
>> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
>> sh: D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\script.sh: command not 
>> found
>>
>> Can you please advise what could be wrong here?
>>
>> Regards,
>> Rupali
>>
>

-- 
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/cb24576a-c926-4077-b3df-d2439f15ad0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-01 Thread Rupali
HI Ninad,

Thank for the reply. But it doesn't work.
Thing is, shell execution works well as part of normal Jenkins job, as a 
build step.
But it fails to work when I add it as workflow step.
Not sure if workflow plugin has a different way to invoke shell scripts 
than traditional Jenkins shell script execution.

Regards,
Rupali

On Friday, November 28, 2014 3:09:05 PM UTC+5:30, Rupali wrote:
>
> Hi,
>
> I tried a simple command in shell script as below:
> sh 'echo Hello'
>
> It gives below error:
>
> [D:\Jenkins-Slave\workspace\Setup-WF] Running shell script
> cygwin warning:
>   MS-DOS style path detected: 
> D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\pid
>   Preferred POSIX equivalent is: 
> /cygdrive/d/Jenkins-Slave/workspace/Setup-WF/.fb8e6a28/pid
>   CYGWIN environment variable option "nodosfilewarning" turns off this 
> warning.
>   Consult the user's guide for more details about POSIX paths:
> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> sh: D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\script.sh: command not 
> found
>
> Can you please advise what could be wrong here?
>
> Regards,
> Rupali
>

-- 
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/a0c5a6c2-75e5-432d-a204-9e00cf261042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow-plugin] Error "script.sh: command not found" when running shell script

2014-12-01 Thread niraj nandane
Hi,
Install cygpath plugin and write 
#/bin/bash before echo Hello statement

On Friday, November 28, 2014 3:09:05 PM UTC+5:30, Rupali wrote:
>
> Hi,
>
> I tried a simple command in shell script as below:
> sh 'echo Hello'
>
> It gives below error:
>
> [D:\Jenkins-Slave\workspace\Setup-WF] Running shell script
> cygwin warning:
>   MS-DOS style path detected: 
> D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\pid
>   Preferred POSIX equivalent is: 
> /cygdrive/d/Jenkins-Slave/workspace/Setup-WF/.fb8e6a28/pid
>   CYGWIN environment variable option "nodosfilewarning" turns off this 
> warning.
>   Consult the user's guide for more details about POSIX paths:
> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> sh: D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\script.sh: command not 
> found
>
> Can you please advise what could be wrong here?
>
> Regards,
> Rupali
>

-- 
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/f2b43d69-a68b-4618-b28e-6ea24dafe653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[workflow-plugin] Error "script.sh: command not found" when running shell script

2014-11-28 Thread Rupali
Hi,

I tried a simple command in shell script as below:
sh 'echo Hello'

It gives below error:

[D:\Jenkins-Slave\workspace\Setup-WF] Running shell script
cygwin warning:
  MS-DOS style path detected: 
D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\pid
  Preferred POSIX equivalent is: 
/cygdrive/d/Jenkins-Slave/workspace/Setup-WF/.fb8e6a28/pid
  CYGWIN environment variable option "nodosfilewarning" turns off this 
warning.
  Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
sh: D:\Jenkins-Slave\workspace\Setup-WF\.fb8e6a28\script.sh: command not 
found

Can you please advise what could be wrong here?

Regards,
Rupali

-- 
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/8fa5781c-8ffb-4565-9abb-884465b122c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.