on 2014 Oct 07 10:25 AM
Jenkins seems to fail when trying to run . ./setantenv.sh (I think it has a problem with . ./).
sh setantenv.sh works but then ant cannot be found
bash setantenv.sh does the same as above.
Anyone got this working?
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
I think, the following should work:
bash -c ". ./setantenv.sh && ant"
Thus, you'll st bash, load the ant environment into that shell and execute ant.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use Jenkins "Exec command" and do:
. /path/setantenv.sh ant clean all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
there's a bash builtin "source" which does the same thing: http://ss64.com/bash/source.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I fixed this by doing something a little lame, but works and doesn't require me to extract out the details of the setantenv script. I had an issue with Simply call the setantenv.sh script from another bash script. The shebang at the top will tell /bin/sh to go to the right place to run the script and it will also satisfy setantenv.sh's . ./ requirement.
#!/bin/bash
. ./setantenv.sh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
make sure /bin/sh points to /bin/bash - you can do this dpkg-reconfigure dash on debian. Then just source the setantenv.sh file and it should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I kind of like what Christoph is saying but we did it a different way. The setantenv.sh script doesn't do every much and it also does one thing which is kind of annoying (setting the heap size ridiculously small).
This is what the script does
PLATFORM_HOME=`pwd`
export -p PLATFORM_HOME
export -p ANT_OPTS="-Xmx200m -XX:MaxPermSize=128M"
export -p ANT_HOME=$PLATFORM_HOME/apache-ant-1.9.1
chmod +x "$ANT_HOME/bin/ant"
export -p PATH=$ANT_HOME/bin:$PATH
You could set these as normal env variables or script them into your Jenkins job which also allows you to increase the heap size for ant.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not just create an ant build step inside your jenkins job? You can configure the ant version and just give the tasks to run. There should be no need to call ant via shell.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thats what we did also. As we know that hybris is running ant 1.9.1; we got it from apache ( http://archive.apache.org/dist/ant/binaries/) and installed it directly on the machine, then linked that installation with hudson/jenkins, and use it to build hybris.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.