Giter Site home page Giter Site logo

stoplight's Introduction

Stoplight

Build Status

Introduction

Stoplight is a build monitoring tool that is largely based off greenscreen, but is much improved and expandable. To quickly name a few, Stoplight has:

  • built-in support for Jenkins
  • built-in support for Travis-CI
  • custom provider support
  • community contributions
  • full test suite
  • resuable DSL

Stoplight is designed to be displayed on large television screens or monitors. It automatically resizes to fill the maximum real estate the screen can offer.

Installation

Stoplight is a Rack application, so you'll need to install Ruby and Rubygems before you can run Stoplight. Stoplight requires Ruby 1.9.x.

Start by cloning the application repository:

git clone [email protected]:customink/stoplight.git

And then bundle all the application's dependencies:

bundle install

Next, copy the config/servers.example.yml file to config/servers.yml:

cp config/servers.example.yml config/servers.yml

If you want to get up and running quickly and just see what Stoplight looks like, add the following to your configuration file. It will pull data from the public repos of the Travis CI project itself:

-
  type: 'travis'
  url: https://api.travis-ci.org
  build_url: https://travis-ci.org
  owner_name: travis-ci

Start the server with the rackup command:

rackup ./config.ru

Navigate to http://localhost:9292 and check it out! You should see the status of a bunch of builds. The screen will refresh every 15 seconds to keep itself up to date.

Configuration

All configuration options are specified through the config/servers.yml file we copied over before. There's significant documentation in that file on how to configure your servers.

All servers must specify a type option. This tells Stoplight what provider it should use. For example, if you are using Travis CI, your provider is Travis and the server type is travis. If you were using a custom server, the configuration might look like:

-
  type: 'my_server'
  url: '...'

This would look for a provider named MyServer under lib/stoplight/providers. For more information on writing a custom provider, see the Contributing section.

If you have a lot of projects, you may want to selective display them on Stoplight. Luckily, this is just a simple configuration option. To ignore certain projects, just add the ignored_projects field to the config. It even supports regular expressions:

-
  type: 'travis'
  url: 'http://api.travis-ci.org'
  ignored_projects:
    - /^rails-(.*)$/
    - some_other_project

Conversely, you can choose to only show certain projects with the projects option:

-
  type: 'jenkins'
  url: 'http://jenkins.mycompany.com/cc.xml'
  projects:
    - /^public-(.*)$/
    - some_other_project

Configuration for Travis CI

For public repos on travis-ci.org use the sample config provided (see above).

For private repos on travis-ci.com, you will need an access token for the Travis CI api. As the corresponding API endpoints have not been implemented yet, the easiest way is to first create a Github access token and then use this to generate a Travis CI access token:

curl -d "github_token=your-github-token" https://api.travis-ci.com/auth/github
  • Use the token from the response as the value for "access_token" in your servers.yml file.

Contributing

The development environment is configured with all kinds of goodies like Spork, Guard, and Foreman. If you're developing, just run foreman start and code! As you write tests and code, Guard will run the tests, Spork will make it fast, and Growl will tell you if they passed or failed!

Providers

One of the larger goals of Stoplight was to server the open source community. As more Continuous Integration servers emerge, we needed a common DSL for interacting with them. This all arose when we wanted to add Travis CI support to Greenscreen. Greenscreen was written for CI's that conform to a standard that doesn't even exist anymore. Stoplight doesn't care how the data comes in from the provider!

A Provider is really just a ruby class that defines two methods:

class MyProvider < Provider
  def provider
    'my provider'
  end

  def projects
    # logic here
  end
end

The provider method is just a utility method that returns the name of the provider. The projects method is the "magical" method. This is where a developer parses the data into the given specification. You should take a look in lib/stoplight/providers/sample.rb for a good starting point.

Views/Styles/Layouts

If you are looking to change the design, add styles or javascripts, you'll need to know a little bit about the architecture of the application.

  • All javascript should be written in coffeescript. The coffeescript files live in app/assets/javascripts. They are compiled to public/javascripts.
  • All css should be written in scss + compass. The scss files live in app/assets/stylesheets. They are compiled to public/stylesheets.

Deployment

Deploying Stoplight to Heroku is a snap.

Of course, if your build servers aren't publicly accessible, Heroku won't be a great option. A Chef Cookbook for deploying Stoplight is available on the Opscode Community site. You can read more about both options in Nathen Harvey's blog. Note that, in his post, Nathen talks about Greenscreen. Stoplight can be deployed in the same manner.

William Durand also ported a Puppet Module for installing Stoplight.

Credits

  • GreenScreen was original developed by martinjandrews.
  • The former version of GreenScreen was a fork of the updates made by rsutphin.
  • This version of Stoplight was written by sethvargo

stoplight's People

Contributors

attachmentgenie avatar egspoony avatar jondot avatar martinjandrews avatar michaelkrenz avatar nathenharvey avatar nhessler avatar rcreasey avatar robwilliams avatar rsutphin avatar sethvargo avatar willdurand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stoplight's Issues

stoplight redesign-white

Hi guys,
Sorry for the late response, been quite sick this week. We had a little discussion over twitter, if you remember, so I cleaned up what I was working on and able to present this demo:

http://stoplight-white-demo.herokuapp.com/index.html

Take into account its very packed (jruby CI) so that it will showcase all of the range of UI concepts it holds.

This is a major step away from the existing stoplight UI. Here is the logic / reasoning behind it:

These are the goals I've set to myself;

Stoplight is an information radiator. The key goals are to radiate health, and current activity of all projects.

More detailed, Stoplight needs to display the current status of every project, it should indicate a building project distinctively, it should also give a sense of time across the board, each project should be eyed with a glance easily (with no need to seek it), it should display all projects to provide a solid grasp for the overall health with a glance.

Practically, this meant:

  • current status is displayed by color keys (gray, red, green) with the build circle, and on cases (see below) on the title itself
  • a building project is displayed by a fade-in-fade-out circle
  • the sense of time, is pronounced as follows: for a freshly successfully built project - its title will remain lit green for an order of minutes or hours (configurable). A successful non-fresh project is gray with a green circle. A very old ("old" is configurable) successful non-fresh project is losing its grayness gradually becoming very light gray. A failed project will always remain red regardless of time.
  • no need to seek for projects every time again. this is because projects are sorted alphabetically and remain consistent on the board regardless of build time (which is the most natural order for humans to seek on). This means we can no longer sort by build date (this is why I chose fading colors to represent the sense of time)
  • all projects are displayed at once.

This, if you choose to accept is, what I'm offering on my fork :)

I didn't bother with a pull request because I understand that this is a significant departure from the current UI, so let me know if this make sense for you

Have a good one.

Nothing showing

After I've configured a server in the config file and I visit the page I get the "Sinatra doesn’t know this ditty" page showing up.

If I visit /projects.json I do get a list of jobs from Jenkins. I don't know if I'm doing something wrong or if it might be related to stoplight.

undefined method `iso8601`

I used the stoplight recipe to install stoplight. The installation process went fine. But when I hit the server, it returned 500 internal error.

A quick look at the httpd/log/error.log showed the following:

[WARNING] MultiJson is using the default adapter (ok_json). We recommend loading a different JSON library to improve performance.
NoMethodError - undefined method `iso8601' for #<DateTime: 53051722853/21600,0,2299161>:
        ./views/index.erb:27:in `evaluate_source'
        ./views/index.erb:22:in `each'
        ./views/index.erb:22:in `evaluate_source'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:636:in `render'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:522:in `erb'
        ./application.rb:27:in `GET /'

I am running a centOs 5.6 x86_64, chef-0.10.8, ruby 1.8.7 (2011-06-30 patchlevel 352) and gem 1.8.10.

Thanks,

ERROR NoMethodError: undefined method `write'

Hi,

I got following stacktrace when trying to run the server:

[2012-09-25 08:34:26] INFO  WEBrick 1.3.1
[2012-09-25 08:34:26] INFO  ruby 1.8.7 (2010-01-10) [i486-linux]
[2012-09-25 08:34:31] INFO  WEBrick::HTTPServer#start: pid=23823 port=9292
10.0.0.51 - - [25/Sep/2012 08:34:51] "GET / HTTP/1.1" 404 435 0.0177
[2012-09-25 08:34:51] ERROR NoMethodError: undefined method `write' for #<Logger:0xb6f085f0>
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/commonlogger.rb:33:in `log'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/commonlogger.rb:22
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/body_proxy.rb:17:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/body_proxy.rb:17:in `close'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/lint.rb:555:in `close'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/body_proxy.rb:15:in `close'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:75:in `service'
        /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
        /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
        /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
        /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
        /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:13:in `run'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/bin/rackup:4
        /usr/bin/rackup:23:in `load'
        /usr/bin/rackup:23

Any ideas what it could be?

Ruby = 1.9.1

RubyGems = 1.8.24

cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.