Hudson allows us to specify the ant version that we want to use. Now, what I want to do is having Hudson call my perl script which then will call ant. how do I do this?
When I tried to call ant from perl script that was called from Hudson, I got the following error:
Can't exec "ant": No such file or directory at ...........
I understand that this error means "ant" is not in the path. The thing is that if I provide the exact location or add ant to the path, then that means I am not using ant that I specified from Hudson.
Can anyone help?
It looks like you don't actually want to invoke ant as a Hudson build step which will happen if you add it as a build step. How about making it a parameterized Choice as ANT_VERSION with options: /opt/apache-ant-1.8.0, /opt/apache-ant-x.y.z, etc. Then in your Execute Shell build step do:
my-perl-script.pl --ant-version=${ANT_VERSION}
where your script takes the path to the ant version as a paramter.
Related
I am running Jenkins on a script, that generates a junit.xml report file and other files. However, all those files are zipped by the script, hence Jenkins cannot find it.
Is there a way to make Jenkins unzip the .zip file , find my particular junit file and generate the run results ?
All this is in Linux.
Thanks
Jenkins has the ability to execute arbitrary shell commands as a build step, just add the 'Execute Shell' step to your build and put in the commands you want (presumably 'unzip' would be among them).
Once you've extracted the xml, provided your internal tool generates it using this schema the JUnit plugin just needs the path you extracted to and it will show the results on the build page.
If you have the option, I would really suggest executing your tests via gradle or maven, as outputs from those tasks will produce a report that Jenkins (and other tools) can already read, and can streamline the job setup process for your users. But, if you can't get away with that, the above should work for you.
My script (MyScript.tcl) includes this line:
load MyTclBridge.dll
And when I run it this way:
tclsh MyScript.tcl
It runs ok, but when I use RamDebugger to run MyScript.tcl, it stops with this error:
couldn't load library "MyTclBridge.dll":
this library or a dependent library could not be found in library path
while executing
"load MyTclBridge.dll"
("after" script)
MyTclBridge.dll is located in C:\Windows\System32. How can I run my script with the debugger?
With problems like this I usually start with Dependency Walker as this will show you which other Dlls MyTclBridge relies on. You can then use the env variable that Tcl maintains to show you what the actual PATH that your script has when running under RamDebugger - so check that MyTclBridge and all of it's dependancies are on the PATH.
Okay, so.
I've installed Ant.
Downloaded the build script. Extracted to Ant installation location.
When I run the 'runbuildscript' a cmd interface opens for around a second, and stops.
If I navigate to the location of files through CMD, then do ant minify it doesn't work.
I then thought to place and extract the build script in the location of the files.
Upon doing so, an error came -
BUILD FAILED
E:\NamanyayG\wamp\www\namanyayg\build.xml:150: The following error occurred whil
e executing this line:
E:\NamanyayG\wamp\www\namanyayg\build.xml:416: E:\NamanyayG\wamp\www\${dir.source} does not exist.
Please help me out, I'm thoroughly confused.
Build script expects some external process (in this case you) to set dir.source property.
The most sure way to set it is to define it on ant command line, e.g.
ant -Ddir.source=/path/to/dir.source
I'm trying to hook up our own private testing tool to Jenkins. I'm able to run the test through the command line and create a report on my local machine. I will need to convert that report to xml JUnit format, specifically for Jenkins. Once that is done, how do I associate the xml file that was just created to the most recent job. This way the correct report gets put with the correct job?
The way Jenkins works is simple: you create a job and Jenkins runs it. Every run of a job is called a build. If you configure the job to look for test report files at the end of a build, the test reports are loaded and presented in the Jenkins UI. There is no way to submit test reports to a build outside of the build or after the build.
Usually this is not a problem. You run your test program/script as part of the build and it produces xml files in the JUnit format. When all the build steps are done, Jenkins looks for the xml files and loads them. You have to tell Jenkins to do it, though. You open the job configuration and you add a new post-build action titled "Publish JUnit test result report". Then you give Jenkins a pattern it uses to search for the files. You can use **/*.xml which means Jenkins will look for all *.xml files in every directory and subdirectory. Or you can e.g. use **/testreports/*.xml if you know where the test reports are going to be.
I tried to do this in Hudson but:
I have a script in Perl on my server (windows): lets say: d\util\demo.pl I want to have it running in Hudson. so I go to Hudson, create new job, go to: Build Execute Windows batch command and add: perl.exe d\util\demo.pl
I got this error: 'perl.exe' is not recognized as an internal or external command, operable program or batch file.
please help!
It can't find the perl.exe in the path of the agent that is running the task. Verify that perl is properly installed AND that the path where perl.exe was in stalled to is in you system path on EVERY agent that will run this task.
Can you run that command from any folder of the server?
If yes, than the Hudson server runs definitely under a different user account. Make sure that the user account Hudson is running under has all necessary environment variables set.
If not, than add the full qualified path to the perl.exe (e.g. C:\program files\perl\bin\perl.exe d:\util\demo.pl). If this doesn't help, you have to also set all environment variables (see "if yes").