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.

Friday, August 9, 2013

linux: demonizing a process and killing it when you want

This is very useful for processes which do not write an PID file. This is stupid... but it could be work-arounded.

For example I want to start ant kill later the jasmine server, which is started this way:
bundle exec rake jasmine:server --trace

magic apostrophes in linux = Back Quotes for Command Substitution

They are replaced by the output of the command between them:

kill -9 `echo 9999`

is equivalent to:

killing app, listening on a defined port in single line

In Linux this will kill the process, listening on port 8888:

ps aux | grep port=8888 | awk '{print $2}' | tail -n 1 | xargs kill -9

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


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