Re: "curl: (7) couldn't connect to host error" in Execute shell build step

2013-07-16 Thread Ling-Yi Kung
Ah, that was the problem! Thanks! Most of my environment variables were 
missing when non-interactive shells ran.

On Tuesday, July 16, 2013 10:46:40 AM UTC-7, JonathanRRogers wrote:
>
> Ling-Yi Kung wrote: 
> > On Tuesday, July 16, 2013 9:19:26 AM UTC-7, JonathanRRogers wrote: 
> > 
> > So you were able to run " 
> > 
> > curl 
> https://raw.github.com/appium/appium/master/sample-code/examples/node/simplest.js<
> https://raw.github.com/appium/appium/master/sample-code/examples/node/simplest.js>"
>  
> interactively on the same host? 
> > 
> > 
> > Yes. I'm using my local machine as a slave, and everything in my 
> > script works when I run it myself. 
> > 
>
> The environment will be different. The first thing I'd suspect is the 
> need for a proxy to connect to GitHub. Are there environment variables 
> like http_proxy or HTTP_PROXY when you run commands interactively? Is 
> the host behind some corporate firewall that prevents direct HTTPS 
> connections? 
>
> -- 
> Jonathan Rogers 
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: "curl: (7) couldn't connect to host error" in Execute shell build step

2013-07-16 Thread Jonathan Rogers
Ling-Yi Kung wrote:
> On Tuesday, July 16, 2013 9:19:26 AM UTC-7, JonathanRRogers wrote:
>
> So you were able to run "
>
> curl 
> https://raw.github.com/appium/appium/master/sample-code/examples/node/simplest.js
>  
> "
>  interactively on the same host?
>
>
> Yes. I'm using my local machine as a slave, and everything in my
> script works when I run it myself.
>

The environment will be different. The first thing I'd suspect is the
need for a proxy to connect to GitHub. Are there environment variables
like http_proxy or HTTP_PROXY when you run commands interactively? Is
the host behind some corporate firewall that prevents direct HTTPS
connections?

-- 
Jonathan Rogers

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: "curl: (7) couldn't connect to host error" in Execute shell build step

2013-07-16 Thread Ling-Yi Kung
On Tuesday, July 16, 2013 9:19:26 AM UTC-7, JonathanRRogers wrote:

> So you were able to run "
>
> curl 
> https://raw.github.com/appium/appium/master/sample-code/examples/node/simplest.js";
>  interactively on the same host?
>
>
Yes. I'm using my local machine as a slave, and everything in my script 
works when I run it myself.

Exactly which scripts are executed on startup depends on the shell and the 
> options it was invoked with.  As you can see, Jenkins is invoking "/bin/sh 
> -xe". You should check whether /bin/sh is Bash or something else. If it is 
> Bash, consult the manual to see exactly what those options mean and what 
> happens at startup:
>
> http://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin>
>  http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files>
>
> If it is Bash, no startup files are read because it is executed as the 
> name "sh" non-interactively. This is a good thing because it makes it 
> easier to control the environment separately from interactive logins. I use 
> a script just for setting build-related environment variables which I 
> source within the scripts in Jenkins jobs rather than ~/.bash_profile.
>

I see! Thanks for the info - that makes more sense now.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: "curl: (7) couldn't connect to host error" in Execute shell build step

2013-07-16 Thread JonathanRRogers
On Monday, July 15, 2013 5:06:02 PM UTC-4, Ling-Yi Kung wrote:
>
> Hello! I'm trying to run some simple shell commands. However, curl is 
> giving me an error. I'm a bit confused on why that is? From the terminal of 
> the slave, I can execute the commands without error.
>
> Started by user lkung
> [EnvInject] - Loading node environment variables.
> Building remotely on lkung-laptop in workspace 
> /Users/lkung/workspace/appium-ios-test
> [appium-ios-test] $ /bin/sh -xe 
> /var/folders/d8/1dl9bdcs4p761ymwc75xw6rcgr/T/hudson7427721755623892783.sh
>
> + mkdir appium-test
> + cd appium-test
> + curl 
> https://raw.github.com/appium/appium/master/sample-code/examples/node/simplest.js
>
>
So you were able to run "

curl 
https://raw.github.com/appium/appium/master/sample-code/examples/node/simplest.js";
 interactively on the same host?



> Another question I have is how to use the slave's own environment 
> variables? Particularly PATH? Right now, I'm running "source 
> $HOME/.bash_profile" before running any other command.
>

Exactly which scripts are executed on startup depends on the shell and the 
options it was invoked with.  As you can see, Jenkins is invoking "/bin/sh 
-xe". You should check whether /bin/sh is Bash or something else. If it is 
Bash, consult the manual to see exactly what those options mean and what 
happens at startup:

http://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin>
http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files>

If it is Bash, no startup files are read because it is executed as the name 
"sh" non-interactively. This is a good thing because it makes it easier to 
control the environment separately from interactive logins. I use a script 
just for setting build-related environment variables which I source within 
the scripts in Jenkins jobs rather than ~/.bash_profile.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.