[EnvInject] - Loading node environment variables. [EnvInject] - Preparing an environment for the build. [EnvInject] - Keeping Jenkins system variables. [EnvInject] - Keeping Jenkins build variables. [EnvInject] - Executing and processing the following script content: set -e set +x #!/bin/sh cd /tmp/ rm -rf bc_env.txt echo "SANDBOX:${sandbox}" >> /tmp/bc_env.txt echo "SERVER:${aquarius}" >> /tmp/bc_env.txt echo "############" cat /tmp/bc_env.txt [wmtst.jenkins] $ /bin/sh -xe /var/tmp/hudson928408455192591691.sh [EnvInject] - Script executed. The exit code is 255. [EnvInject] - Fail the build.
And at last the build failed.So is there anyone there to help me.I am confused.
Regards,
Nayan
Hi All,
I am executing a shell script using jenkins on a hpux machine.
It goes like this.
------------------------------------------------------
set +e
set +x
#!/bin/sh
cd /tmp/
rm -rf bc_env.txt
echo "SANDBOX:${sandbox}" >> /tmp/bc_env.txt
echo "SERVER:${aquarius}" >> /tmp/bc_env.txt
echo "############"
cat /tmp/bc_env.txt
-------------------------------------------------------
Nayan Jyoti Gogoi (2015-09-30 14:44):
Hi All,
I am executing a shell script using jenkins on a hpux machine.
It goes like this.
------------------------------------------------------
set +e
set +x
#!/bin/sh
cd /tmp/
rm -rf bc_env.txt
echo "SANDBOX:${sandbox}" >> /tmp/bc_env.txt
echo "SERVER:${aquarius}" >> /tmp/bc_env.txt
echo "############"
cat /tmp/bc_env.txt
-------------------------------------------------------
This is an extremely simple script, so the failure has to be too simple to look for ;^P
Are you out of disk space in /tmp, or have a permission issue for the Jenkins user with /tmp/bc_env.txt ?
Put your shebang line as the first line, or it is simply read as a comment. I’ve used bash in this context before, as /bin/sh is an unknown shell. For instance on Ubuntu it is /bin/dash instead. If I remember correctly on HP/UX, /bin/sh is the ancient Bourne shell which probably does not understand what set +e means.
Remove the set +x line. That is stopping you from seeing the failing line.
Also, a small point: rm –rf is for recursive delete, which is unnecessary. Just use rm –f instead. And maybe fix the indentation mess.
--
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/560CDBF1.4030204%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.
Are you sure it's legal/portable to put things *before* the shebang?
My 2 cents
--
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/7a4cfc2e-a48a-4201-8941-1bd0287f7be6%40googlegroups.com.