Nathen Harvey

a blog

Deploying Green Screen

In my previous post, I introduced Green Screen, a build monitoring tool that is designed to be used as a dynamic Big Visible Chart (BVC) in your work area. It lets you add links to your build servers and displays the largest possible information on a monitor so that the team can see the build status from anywhere in the room.

It is easy enough to get Green Screen up and running on your own server or VM. The project’s README includes all the information you’ll need for doing so. In this post, I’ll describe the steps necessary to run Green Screen on Heroku or on your own server using Chef.

Deploying to Heroku

Deploying to Heroku is probably the easiest way to get up and running with Green Screen. You’ll need a Heroku account but a free one should be sufficient. Check the quick start guide if you don’t yet have an account.

Once you’ve got your Heroku account set-up, simply follow these steps to get your Green Screen app deployed:

  1. git clone git@github.com:customink/greenscreen.git
  2. cd greenscreen
  3. gem install heroku
  4. heroku create
  5. git push heroku master
  6. heroku open

If your build servers are running on the Internet, Heroku may be all that you need.

Warning this default Green Screen looks at all of the builds currently running on http://ci.jenkins-ci.org. This is fine for demo purposes but you may find it to be a bit overwhelming since it’s over 300 builds at the time of this writing.

You can see a sample of this app running at http://greenscreenapp.com

Deploying with Chef

If your build servers are not publicly accessible, Heroku won’t be a great option. CustomInk has published a Chef cookbook for setting up Green Screen on one of your nodes.

You simply need to include the greenscreen recipe to install, configure, and run one or more GreenScreen applications. Or add it to your role, or directly to a node’s recipes.

1
include_recipe "greenscreen"

Of course, if you’re just getting started with Chef, you should look at Vagrant which is a tool for building and distributing virtualized development environments. With Vagrant, you can quickly spin-up a VM in VirtualBox and have it use the greenscreen cookbook.

The cookbook allows you to specify credentials and jobs to include or ignore with each server and allows you to set-up multiple Green Screens on the same node. At CustomInk, we use different Green Screen applications for different teams.

Here’s an excerpt from one of our Chef environment files:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"greenscreens" => [
  {
    :name => "greenscreen",
    :port => "4567",
    :servers => [
      {
        :url => "http://build01.customink.office:8080/cc.xml"
      },
      {
        :url => "http://build02.customink.office:8080/cc.xml",
        :username => "hudson",
        :password => "hudson_password"
      },
      {
        :url => "http://build03.customink.office:8080/cc.xml",
        :username => "hudson",
        :password => "hudson_password",
        :ignore_jobs => ["www_redirects"]
      }
    ]
  },
  {
    :name => "greenscreen.webops",
    :port => "4568",
    :servers => [
      {
        :url => "http://build03.customink.office:8080/cc.xml",
        :username => "hudson",
        :password => "hudson_password",
        :jobs => ["www_redirects"]
      },
      {
        :url => "http://build04.customink.office/cc.xml",
        :username => "jenkins",
        :password => "jenkis_password"
      }
    ]
  }
]

With this configuration, we have 2 Green Screens running, on ports 4567 and 4568. Both are polling build servers and showing different jobs. For instance, the server on 4567 excludes the www_redirects build (:ignore_jobs => ["www_redirects"]) whereas the server on 4568 only includes this build (:jobs => ["www_redirects"]) when polling the build03 server.

Comments