[Engine-devel] How to utilize Jenkins to do your dirty (build) work for you...

Mike Kolesnik mkolesni at redhat.com
Mon Mar 26 14:08:13 UTC 2012


Hi, 


-- Intro -- 
  When working on your local GIT repo you probably do a lot of: 
    mvn clean install 

  Additionally, if you're working on oVirt-engine you might be doing some of: 
    mvn test -Penable-dao-tests 
    mvn install -Pgwt-admin 
    etc.. 

  This, of course, might take your development computer a while, and hog your resources. 

  Usually though, if you work on oVirt, you have a host that you use for testing your changes.. 
  This host probably has a 2/4 cores CPU and at least 4Gb of RAM.. 

  This host is sitting quietly most of the time, consuming mostly electricity but not doing much. 
  You're probably not even utilizing it that much even when you are testing something on it. 
  It is like a powerful guard dog that you keep tied in the back-yard most of the time, instead of letting it run free. 

  Well, I have a suggestion how to put that puppy into good use and also free up your resources.. 

-- End Intro -- 

You can install Jenkins on the host, and have it monitor your local GIT repo for changes, building your commits as necessary.
This works with every local branch you have - Jenkins will pick up the change (be it a local commit you just did, or a rebase over the origin) and generate a build for it.

This will allow you to monitor your build results just as you would monitor locally, while in the same time utilize a (probably) more powerful machine to do this for you. It will also probably speed up your build cycle, as builds will be executed in parallel. 

I have written an installation guide which explains how to do it in the oVirt wiki: 
  http://www.ovirt.org/wiki/Local_Jenkins_For_The_People 

I have also written a script that will run the installation part on the host for you, 
so you just need to download the attachment and run it as root on the host, but you will still need to do some manual work so make sure to check the wiki.

-- Example Jobs --
  I am also attaching sample jobs to import to Jenkins.
  Make sure to replace the GIT repo URL, you can do this before importing with sed:
   # sed -i 's#[git-repo-url]#ssh://[user]@[git-host]/[git-repo-location]#' oVirt-engine.*

  For example:
   # sed -i 's#[git-repo-url]#ssh://mkolesni@myhost/~/git/ovirt-engine#' oVirt-engine.*

  You can import them with the command:
   # cat [job].xml | java -jar /tmp/jenkins-cli.jar -s http://localhost:8080 create-job [job-name]

  For example:
   # cat oVirt-engine.xml | java -jar /tmp/jenkins-cli.jar -s http://localhost:8080 create-job oVirt-engine
-- End Example Jobs --

Of course, this might not be ideal in cases when you need 100% percent of your host.. 
But in such a case you can simply turn off Jenkins, and turn it back on later. ;) 


Regards, 
Mike 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jenkins.sh
Type: application/x-shellscript
Size: 5125 bytes
Desc: not available
URL: <http://lists.ovirt.org/pipermail/engine-devel/attachments/20120326/7ac51fbf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oVirt-engine.jobs.tar.gz
Type: application/x-compressed-tar
Size: 2388 bytes
Desc: not available
URL: <http://lists.ovirt.org/pipermail/engine-devel/attachments/20120326/7ac51fbf/attachment-0001.bin>


More information about the Engine-devel mailing list