How to configure Post build tasks in Hudson? - hudson

Hi I am using Hudson for source code management. I am able to correctly download the required code from my feature branch and successfully build it.
But I also require to trigger an .exe file once my build has been successful which I am unable to figure out.
Do I have to use some plugin or there is some other way? If it is a plugin please specify how to set up.
Additional Details: I can trigger the exe perfectly from the command prompt but when I write the same command in the Build step of my job, I just get a "Finished: Success" message but not exe has been triggered

You can use Post build task plugin : http://wiki.hudson-ci.org//display/HUDSON/Post+build+task.
To add this plugin in your project, just search for 'post build' on plugin's search page and install it.
After that you can configure on your job's page. It will appear a checkbox with this label: 'Post build task'.

Related

How do I use html5bolierplate build script?

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

Jenkins/Hudson Upload to Testflight

I have a jenkins job using xcode to build my ipa file. That is all working great. Right now I just have the Marketing version set to ${BUILD_ID} and the technical version set to ${BUILD_NUMBER}. I also have Release configuration specified and my job is set to archive the ipa files as a post build action. I believe those combination of settings causes my resulting IPA file to be the following:
Target-Configuration-BUILD_NUMBER.ipa
So if my target was named BillyBob and this was the 23rd successful build, my resulting .ipa file is:BillyBob-Release-23.ipa
I want to setup a job or post-build action to upload my file to testflight on a successful build.
I can not figure out what to set the file parameter of the testflight API to so that it will always find the latest build file, I don't think there is a wildcard available or if there is I don't know how to set it.
Originally, when I wasn't setting the technical version as part of the build I had it just pointed to the -1.0.ipa version of the file it was creating and that would get uploaded fine.
I've tried using both the testflight plugin for jenkins and just a curl shell script command.
I will also point out that I'm not an iOS developer, I've just been trying to help the project by setting up the automated build, so my guess as to how that file is getting generated could be way off.
***UPDATE
So it looks like this current open issue is kind of what I am looking for
jenkins issue section
For now, I just had my job specify an output path that is the workspace of my upload to testflight job.
It looks like in the Testflight app, if you don't specify anything for the IPA file, it looks for one in the workspace directory of that job. So I could probably also put in a request to the testflight plugin to allow you to specify a path in the IPA setting and have it find the .ipa file in that path, that currently does not work.
If I was better at scripting I could probably also handle it in a shell command using the curl command to upload to testflight.
Leaving those fields empty in Jenkins fixed it for me.
If you do not specify the ipa/dsym file(s) they are searched for
automatically in the workspace.
As you can see from:
https://wiki.jenkins-ci.org/display/JENKINS/Testflight+Plugin
Version 1.3.1 (Jan 12 2012)
* Default IPA upload

Hudson/jenkins: disable the failed build

What is the preferred way to disable the periodical build when it has failed? Quick search showed that there is a Prerequisite build step plugin, but that fails the build, and I need the build to be completely disabled until manual intervention.
Thanks.
Okay, I think I managed to find a solution.
Retry Failed Builds plugin didn't work because it could not override the default project schedule, so the failed project got built again and again.
Naginator plugin didn't work because the delay is not configurable.
Prerequisite build step plugin is not suitable.
The solution is to install the Groovy Postbuild Plugin, which is run under the Jenkins JVM and exposes the Jenkins instance publically. So it is possible to programmatically disable the current build directly in the Project configuration:
if (manager.build.result.isWorseThan(hudson.model.Result.SUCCESS)) {
manager.build.project.disabled = true
}
There is a button "Disable project" on the project status page. I simulate button click by HTTP POST message with data "Submit=\"Disable Project\"" like this
wget --post-data "Submit=\"Disable Project\"" ${JOB_URL}disable
right from the bash script which runs the build (project). The whole code can look like this
set +e
# Run test/build
# ....
if [ $? -ne 0 ];
then
wget --post-data "Submit=\"Disable Project\"" ${JOB_URL}disable
# Or you can use following to disable one job from another
# wget --post-data "Submit=\"Disable Project\"" http://<Server>/job/$JOB_NAME/disable
exit -1
fi
This is a rather old question, so I guess there was no Disable/Enable button in Jenkins GUI than. If Jenkins is protected by a password you will need to make wget to login first, store cookies in some file and in the second file add the cookie.

Hudson svn credentials

How to enter subversion credentials in Hudson by shell?
I've tried to generate file hudson.scm.SubversionSCM.xml in HUDSON_HOME and reload configuration, but changes weren't applied.
The easiest way to enter a credential from the shell is to use "svn" executable. Hudson recognizes the ~/.subversion/auth directory that it creates.
Under Windows the global credenentials are stored under %APPDATA%\Subversion\auth. The following Groovy code helps generating these credentials:
SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url))
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.defaultConfigurationDirectory,"AD\user","password",true)
repository.setAuthenticationManager(authManager)
repository.getDir("", -1, null ,(Collection)null) // or some random SVN operation
Libraries used in the code above (example in Gradle):
compile 'org.tmatesoft.svnkit:org.tmatesoft.svnkit:1.7.8'
compile 'net.java.dev.jna:jna:3.4.0' // so wincrypt is available
Make sure you run the code with the same user Hudson runs on the Windows machine.
Just start with the Hudson.
Install all required Plug-Ins.
Hit the link,EX:-localhost:8080/hudson
Click on the add job/Create job.
While choosing the options SVN will be present there,Give the SVN location.
Credentials link is present out there.Click on that link.
A form will get open,provide valid credentials for that location of SVN.
Observe the Success message on the screen and then get back to the Create job,Complete with Job creation and Build the task.

Where do I see the shell script output in Hudson

I have written a shell script to build my project using hudson.
I have put some comments that will be displayed on the console by using echo command. This will help me to debug the scripts if there are any errors. Rigt now the script works fine without any bugs. But in future if there are any errors, I would like to See the logs and identify which part/command of the script is causing the problem.
In this regard I have two questions: 1. Where can I find the logs or the output of the build scripts? 2. Where can I see the hudson log files? I have started hudson by placing the hudson.war file under webapps folder of Tomcat.
You should be able to see the console output for each build by choosing the "Console" menu option on the build menu on the left of the page.
The Hudson logs are visible from within Hudson itself. Just go to "Manage Hudson" on the main menu, then choose "System Log".
I'm not sure if that's exactly what you were looking for. If not, please clarify and I'll try help.