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/1dl9bdcs4p761ymwc75xw6rc0000gr/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:

<URL:http://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin>
<URL: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.


Reply via email to