• Get started
  • Documentation

Integrate Opsgenie with Codeship

Codeship logo

The practice of continuous integration involves repeated automated testing and code merging with notifications to alert developers to problems in their code in real time. Codeship combines this with the practice of continuous delivery, which provides for regular code deployment once changes have passed automated tests. Essentially, when code is pushed to GitHub (or Bitbucket), Codeship rebuilds your application on its secure servers and runs your automated tests. If the tests fail, it notifies your development team via email or integration.

What does Opsgenie offer Codeship users?

Use Opsgenie Codeship Integration to forward Codeship build alerts to Opsgenie. Opsgenie
determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls, and iOS & Android push notifications, and escalates alerts until the alert is acknowledged or closed.

Functionality of the integration

  • When a build alert is created in Codeship, an alert is created in Opsgenie automatically through the integration.

Add Codeship Integration to Opsgenie

If you're using Opsgenie's Free or Essentials plan or if you’re using Opsgenie with Jira Service Management's Standard plan, you can add this integration from your team dashboard only. The Integrations page under Settings is not available in your plan.

  1. Go to Teams and select your team.

  2. Select Integrations on the left navigation and then select Add integration.

Adding the integration from your team dashboard will make your team the owner of the integration. This means Opsgenie will assign the alerts received through this integration to your team only. Follow the rest of the steps in this section to set up the integration.

  1. Go to Settings > Integrations. Search for Codeship and select Add

  2. Specify who is notified of Codeship alerts using the Responders field. Auto-complete suggestions are provided as you type.

  3. Select Save Integration.

Configuration in Codeship Pro

Configuring Build Notifications

To configure build notifications in Codeship, go to Project Settings and click on the Notifications tab.

To add more rules to an existing branch (or branch match), click add to the right of the branch name. To add rules for a new branch (or branch match), click the big new notification button at the bottom of the page.

To remove specific rule trigger for notifications, either disable it (use the toggle on the right-hand side) or delete it completely.

Common Configuration

All rules apply to either “All Branches”, a names branch, or a branch match. If the field is left empty, the rule applies to all branches.

Additionally, all rules can select between started, failed, succeeded, and recovered as events that trigger a notification. Select at least one event in order to save the rule.

started -> sends a notification when a new build is triggered
failed -> sends a notification if a build fails for some reason
succeeded -> sends a notification if the build finishes successfully
recovered -> sends a notification if the previous build failed, but the current build succeeded

Codeship sends build data using Webhook Services

Sample Webhook Message from Opsgenie Codeship Plugin

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "build": { "build_url":"https://www.codeship.com/projects/102xx/builds/97xxxx", "commit_url":"https://github.com/codeship/docs/ commit/96943xxxxxxxxxx", "project_id":102xx, "build_id":97xxxx, "status":"testing", # PROJECT_FULL_NAME IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE "project_full_name":"codeship/docs", "project_name":"codeship/docs", "commit_id":"96943dc5xxxxxxxxxxxxxxxxxx", "short_commit_id":"96xxx", "message":"Merge pull request #34 from codeship/feature/shallow-clone", "committer":"beanixxxx", "branch":"master" } }

The status field has one of the following values:

initiated for newly started build
error for failed builds
success for passed builds
stopped for stopped builds
waiting for waiting builds
ignored for builds ignored because the account is over the monthly build limit
blocked for builds blocked because of excessive resource consumption
infrastructure_failure for builds which failed because of an internal error on the build VM

For more information, please refer to Codeship's Manage Notification and Codeship's Opsgenie Integration Doc

Still need help?

The Atlassian Community is here for you.