lita-travis

Build Status Code Climate Coverage Status

lita-travis is a Lita handler for receiving notifications from Travis CI. When Travis is configured to post notifications to your Lita instance, Lita will announce the results of project builds in chat rooms of your choice.

Installation

Add lita-travis to your Lita instance's Gemfile:

gem "lita-travis"

Configuration

Required attributes

  • token (String) - Your Travis CI secret token, found on your profile page on the Travis website. Default: nil.

Optional attributes

  • repos (Hash) - A hash of repositories names and the chat rooms to post their notifications in. The keys should be strings in the format "github_username/repository_name" and the values should be either a string room name or an array of string room names. Default: {}.
  • default_rooms (String, Array<String>) - A string room name or an array of string room names where notifications for repositories not explicitly specified in the repos hash should be sent. If nil, notifications for unknown repositories will be ignored. Default: nil.

Example

Lita.configure do |config|
  config.handlers.travis.token = "abcdefg123"
  config.handlers.travis.repos = {
    "username/repo1" => "#repo1_team",
    "username/repo2" => ["#repo2_team", "#other_team"]
  }
  config.handlers.travis.default_rooms = "#engineering"
end

Usage

Set the configuration attributes as described in the section above, and add the following to the .travis.yml file for each project you want to get build notifications for:

notifications:
  webhooks:
    urls:
      - http://example.com/travis

Replace "example.com" with the hostname where your instance of Lita is running.

See Travis CI's documentation on notifications for additional options.

License

MIT