Blog

How to Host Jenkins CI on AppCloud

By | December 14th, 2010 at 8:12AM

Post updated to reflect name change from Hudson CI to Jenkins CI

Continuous Integration (CI) must be easy, easier to do, than not to. It should reduce the pain of development. However, for many developers and their companies, the idea of running a CI server garners a meek “yeah, I should, but…” or “we did have a CI server running but it died one day and no one fixed it.”

In this post I hope to convince you why you absolutely need a full time CI solution for your your team or company.

In a coming post I’ll show you how easy it is to run your continuous integration test suite in an environment that matches your production environment. For Engine Yard AppCloud customers this means you will have a one step solution for setting up and running your applications’ CI test suites against AppCloud.

In just two steps that we’ll break into two blog articles, you’ll have a zero-effort CI solution, one as simple as using Engine Yard AppCloud itself.

Which CI?

I’m going to do this in reverse. You are going to install a CI server and then I’ll discuss which one you ought to choose. I know it’s weird, but trust me.

Demo Video

Take nine minutes to watch a quick demo of Jenkins CI. The short demo will walk you through the two steps to get it hosted on Engine Yard AppCloud, and how to setup Post-Commit hooks from GitHub

Host Jenkins CI on Engine Yard AppCloud from Engine Yard on Vimeo.

Hosted CI on Engine Yard AppCloud

Follow these three steps to get setup with a hosted CI server. A summary video is included too.

1. Create an Engine Yard AppCloud account.
2. Using the Quick Start wizard, create an application for git://github.com/engineyard/Jenkins_server.git with default settings, and boot a single instance.
3. On your local computer:

gem install engineyard-jenkins
ey-jenkins install_server


When this is complete, you’ve got yourself a running CI server.

Take 2 – Which CI?

I highly recommend using the Jenkins CI as your CI server. Why Jenkins? One simple reason. As demonstrated, it is very easy to set up. If you have Java installed on your local machine, you can also launch it by clicking here.

Or you can set up a Ruby-flavored Jenkins server using the Jenkins.rb project:

gem install jenkins
jenkins server
open http://localhost:3001

It can be completely configured via its Web UI (see Manage Jenkins on the sidebar), and also from a CLI (the Jenkins.rb project). To add an OSS Ruby project into Jenkins and automatically begin running its test suites:

git clone git://github.com/engineyard/engineyard-jenkins.git
cd engineyard-jenkins
jenkins create . --type ruby
# or
jenkins create . --type ruby --scm git://github.com/engineyard/engineyard-jenkins.git

Use jenkins help create to see the list of options for the create task.

Jenkins CI is a rock solid, open source CI server. It is widely used by many developer communities and is quickly gaining wider adoption within the Ruby/Rails community.

One of the champion features I love about Jenkins CI is that it can be configured to run test suites on alternate target computers. That is, Jenkins can run the unit and integrate my Rails application tests within an Engine Yard AppCloud environment – exactly the same environment as my production application.

This means ZERO setup time for configuring my CI system. A new project can have its tests executed by your CI system within minutes of creating a new Rails application. I want that.

Running CI Test Suites on AppCloud

Stay tuned. Coming soon. The core functionality is working. There is a bit of clean up to make the “getting started” experience ultra-simple. To stay on top of announcements, you can check out our Engine Yard Ruby on Rails blog, the @engineyard Twitter account, our monthly Engine Yard Newsletter, or our new Cloud Out Loud podcast series.

“Is my Jenkins CI supported by Engine Yard?”

Currently Engine Yard is not offering any Support for Jenkins CI. If you have issues with these instructions, please use the Issues tracker for the engineyard-jenkins project. For issues with the jenkins CLI tool use the Jenkins.rb issue tracker.

Jenkins is Ugly. Please Help.

Some people with very attuned aesthetic senses might argue that the Jenkins CI dashboard isn’t 100% good looking. If you are a designer who uses Jenkins CI, and have some ideas about how to fix the Jenkins UX predicament, and how to improve the look’n'feel, please email me. Together, with your help, we can help everyone have a better CI experience.jenkins

  • Rahul

    This is awesome. Thank you so much.

    When do you estimate the next screen cast will be out.

  • mshe

    Rahul, the next post and screencast are in the works. We hope to have them wrapped up in the next week or so. We'll tweet a link to the post and screencast once they're available if you'd like to follow @engineyard on Twitter. Thanks for the feedback on the post. Glad you found it useful :)

  • http://blog.wakatara.com Daryl

    Wow, that is really awesome. Very nice Dr. Nic. I just went through the process of documenting how to do this on Amazon EC2 and it is not nearly as easy (def more setup time):
    http://bit.ly/ep7HRb

    Out of curiosity, does this gem include the setting up for a virtual framebuffer and the like so you can run Cucumber tests? I know I spent a bit of time figuring that out for EC2.

  • http://blog.wakatara.com Daryl

    Sorry, should have been a bit more specific. Does it run capybara stories using javascript? That was what took us a while to figure out with the virtual framebuffer xvfb and firefox sorted.

  • http://drnicwilliams.com drnic

    Initially I was just solving the "get it working at all" then I did "get it working simply" task (which I decided I could in good faith share gleefully!)

    I remember some of the Mocra guys looked at headless js integration testing earlier in the year; but haven't seen a canonical "this is the bestest solution in the world" solution.

    Perhaps can you re-post the headless section of your blog as a stand alone post so people can easly find + reference it? I think the solution to this is very important and significant.

    I don't have anything for this yet in the "ey-hudson" project yet, but would dearly love to have an easy solution to it!

  • http://kevindewalt.com kevindewalt

    Great summary but I’m running into a few challenges. I successfully got Hudson running at http://ec2-204-236-238-234.compute-1.amazonaws.com/

    But when I run ~/ClaimAway$ (master) $ hudson create . –type ruby I get:
    ERROR: Either use –host or add remote servers.

    Seems like the host should have been created automatically in the previous step, but is there a way to manually set it?

    Let me know if I can provide more info. This is a great project idea and I think many small development teams will start using this service because CI is getting more popular.

  • http://kevindewalt.com kevindewalt

    ok, looks like you’re migrating to jenkins, I’ll try to follow the instructions at https://github.com/engineyard/engineyard-jenkins

  • http://drnicwilliams.com drnic

    Yes, just this week I did the migration to jenkins and released engineyard-jenkins gem. I’ll update this post too asap.

  • http://drnicwilliams.com drnic

    Right, it should have set the AppCloud Jenkins instance as your default host. I’ll double check that this is the behaviour with the latest engineyard-jenkins work.

  • Aron Kansal

    Can you use Hudson + MS Build +  engineyard? (This is for a .Net app) Or only Ruby projects?

  • http://drnicwilliams.com drnic

    You can host Hudson/Jenkins on Engine Yard AppCloud and then attach Windows “slave” nodes from EC2 or a publicly accessible Windows machine/VM that you run.