Index ¦ Archives ¦ Atom

Jenkins on OpenShift

How about Jenkins on OpenShift? Let's give this a try. Keep in mind that by default you've got only 3 gears on OpenShift and we'll need to use all of them for this tutorial:

  • 1 will be used by the live app
  • 1 will be used by the jenkins deployment
  • 1 will be used by the jenkins builds

First, create your jenkins deployment:

$ rhc app create -a jenkins -t jenkins-1.4

Then create your app (I'm using the DIY cartridge, but this will work with all other types too):

$ rhc app create -a hellojenkins -t diy-0.1

And add to it the jenkins-client cartridge:

$ rhc app cartridge add -a hello -c jenkins-client-1.4

Now, change your app build file into something useful and push it:

$ cd hellojenkins
$ echo env >> .openshift/action_hooks/build
$ git commit -a
$ git push

Hurry up checking your build on jenkins: https://jenkins-$USERNAME.rhcloud.com/job/hellojenkins-build/

Wow. That was easy! Now imagine what you could do in your pre_build/build/post_deploy scripts with jenkins.

© Giulio Fidente. Built using Pelican. Theme by Giulio Fidente on github. Member of the Internet Defense League.