Showing posts with label hudson. Show all posts
Showing posts with label hudson. Show all posts

Wednesday, June 25, 2014

Trigger Jenkins build on SVN commit with push notification

The continuous integration server Hudson knows several ways to trigger a build. If you’d like Hudson to build your project when the source-base changes and you don’t want to let him poll your Subversion periodically let Subversion trigger the build upon commit. To do that, you need to execute few steps

Jenkins / Hudson configuration

Configure your job in Hudson (Job -> Configure -> Build Triggers) with “Trigger builds remotely (e.g., from scripts)” (”uDoo” is the job name, so replace it with your job name):


hudson_build_trigger

Configure a post-commit hook in your Subversion repository

In the repository directory of your Subversion-server, a directory hook exists. In this directory you may already have a file post-commit with 744 permissions. If not, a file post-commit.tmpl exists. In that case, copy the file and change the permissions:
$ cd path/to/your/repository/hook
$ cp post-commit.tmpl post-commit
$ chmod 744 post-commit
To trigger the build via Subversion, just put the following line at the end of the post-commit file.
wget -b http://HUDSON_URL/job/JOB_NAME/build?token=my_automated_build > /dev/null
That’s it.


This is cached version of this.
To trigger build with password-protected jenkins, you could check this great article.

Thursday, August 15, 2013

Jenkins + Multiple SCMs + git + hooks/triggers = mission Possible

Multiple SCMs plugin version 0.2 - in its documentation is remarked two controversial statements:
  • "Post-commit type triggers don't currently work".
  • "Allow polling to work with multiple instances" - in version 0.2
So is pooling possible? There are people on the internet stating the two opposite points. Yes, it is possible but some tricks are needed.

Tuesday, July 23, 2013

Appending HTML file as e-mail in Jenkins/Hudson

You need "Jenkins Email Extension Plugin", which could be installed from Jenkins/Hudson available plugins. Restart is needed.
You need to fill "Project Recipient List, "Pre-send Script" and correct triggers.

"Pre-send Script" have to be something like this:

def reportPath = build.getWorkspace().child("test.html")
msg.setContent(reportPath.readToString(), "text/html");

Thursday, June 27, 2013

Propagating java system properties to maven project code - issue solved

Issue description: I have got Hudson/Jenkins project. It is build via maven. Maven "Goals and options" is set to
test -DxxxApiConfigFile=config-xxxApi-client-jenkins

Starting console command "mvn test -DxxxApiConfigFile=config-xxxApi-client-jenkins" behaves correctly - the system property is set. But running

Solution: Maven field "Goals and options" has to be set to:
-DargLine="-DxxxApiConfigFile=config-xxxApi-client-jenkins" clean test

or even better:
-DxxxApiConfigFile=config-xxxApi-client-jenkins -DargLine="-DxxxApiConfigFile=config-xxxApi-client-jenkins" test


Sourcehttp://www.cowtowncoder.com/blog/archives/2010/04/entry_385.html