Travis CI Integration

Travis CI cis a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub. Opsgenie's 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.

288

What does Opsgenie offer Travis CI users?

Use Opsgenie's Travis CI Integration to forward Travis CI alerts to Opsgenie. Opsgenie acts as a dispatcher for these alerts and determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls, and iPhone & Android push notifications, and escalates 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 so already.
  2. Go to Opsgenie's Travis CI Integration page.

🚧

For Free and Essentials plans, you can only add the integrations from the Team Dashboards, please use the alternative instructions given below to add this integration.

  1. Specify who is notified of Travis CI alerts using the Teams field. Auto-complete suggestions are provided as you type.

📘

An alternative for Step 2) and Step 3) is to add the integration from the Team Dashboard of the team which will own the integration. To add an integration directly to a team, navigate to the Team Dashboard and open Integrations tab. Click Add Integration and select the integration that you would like to add.

  1. Copy the Webhook URL.
  2. Click Save Integration.
2206

Configuration in Travis CI

  1. Enable the service hook for Travis CI on Github by activating the Github repositories to monitor.
  2. Add the .travis.yml file to the repository.
  3. Add the following configuration to the .travis.yml file.
    notifications:
    webhooks: <webhook-url>
  4. Commit the .travis.yml file to the root of the repository.

Sample Payload

The requestbin.com URL below can be generated from RequestBin.com. You can use the service to create a free HTTPS endpoint. Any HTTP requests sent to that endpoint will be recorded with the associated payload and headers so you can observe the data sent from our webhooks before configuring your application to accept it.

{
  "id": 17413947,
  "repository": {
    "id": 1797493,
    "name": "travisci",
    "owner_name": "halixxxxxx",
    "url": "https://github.com/xxxxxxx/travisci"
  },
  "number": "16",
  "config": {
    "language": "java",
    "jdk": [
      "oraclejdk7",
      "openjdk7",
      "openjdk6"
    ],
    "notifications": {
      "webhooks": [
        "https://[YOUR ENDPOINT ID].x.requestbin.com"
      ],
      "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/halixxxx/travisci/builds/17413947",
  "commit": "b3e6b383453467613cfdab20a6ec2a80c9cb2867",
  "branch": "master",
  "message": "ddaax",
  "compare_url": "https://github.com/halixxxx/travisci/compare/59b70385cf7e...b3e6b3834534",
  "committed_at": "2014-01-22T14:56:29Z",
  "author_name": "halit",
  "author_email": "[email protected]",
  "committer_name": "sistani",
  "committer_email": "[email protected]"
}
Close

Sample Alert

2640