Travis CI Integration

Travis CI cis a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub. OpsGenie is an alert and notification management solution that is highly complementary to Travis CI' alerting mechanism.

OpsGenie Travis CI integration enables Travis CI to create alerts in OpsGenie when the status of a project is failing, broken or errored in Travis CI.

What does OpsGenie offer for Travis CI users?

By using OpsGenie Travis CI Integration, you can forward Travis CI alerts to OpsGenie. OpsGenie can determine the right people to notify based on on-call schedules, using email, text messages (SMS), phone calls and iPhone & Android push notifications, and escalating alerts until the alert is acknowledged or closed.

Functionality of the integration

  • When the status of a project is failing, broken or errored on Travis CI, an alert is created in OpsGenie automatically through the integration.
  • When the status is passed or fixed on Travis CI, the alert is closed in OpsGenie.

Add Travis CI Integration in OpsGenie

  1. Please create an OpsGenie account if you haven't done already
  2. Go to OpsGenie Travis CI Integration page,
  3. Specify who should be notified for Travis CI alerts using the "Teams" field. Auto-complete suggestions will be provided as you type. 
  4. Copy the Webhook URL by clicking on the copy button or selecting.
  5. Click on "Save Integration".

Configuration in Travis CI

  1. Activate your Github reprositories that you want to monitor by enabling the service hook for Travis CI on Github.
  2. Add .travis.yml file to your repository.
  3. Add the following configuration to your .travis.yml file.
    notifications:
        webhooks: <webhook-url>
  4. Commit the .travis.yml file to the root of your repository.

Sample Payload

{
  "id": 17413947,
  "repository": {
    "id": 1797493,
    "name": "travisci",
    "owner_name": "halitokumus",
    "url": "https://github.com/halitokumus/travisci"
  },
  "number": "16",
  "config": {
    "language": "java",
    "jdk": [
      "oraclejdk7",
      "openjdk7",
      "openjdk6"
    ],
    "notifications": {
      "webhooks": [
        "http://requestb.in/10rbzwf1"
      ],
      "on_start": true
    },
    ".result": "configured"
  },
  "status": 1,
  "result": 1,
  "status_message": "Still Failing",
  "result_message": "Still Failing",
  "started_at": "2014-01-22T14:56:52Z",
  "finished_at": "2014-01-22T14:57:50Z",
  "duration": 53,
  "build_url": "https://travis-ci.org/halitokumus/travisci/builds/17413947",
  "commit": "b3e6b383453467613cfdab20a6ec2a80c9cb2867",
  "branch": "master",
  "message": "ddaax",
  "compare_url": "https://github.com/halitokumus/travisci/compare/59b70385cf7e...b3e6b3834534",
  "committed_at": "2014-01-22T14:56:29Z",
  "author_name": "halit",
  "author_email": "halit.okumus@ifountain.com",
  "committer_name": "halito",
  "committer_email": "halit.okumus@ifountain.como"
}

Sample alert