PagerDuty Alerts

New step created pagerduty-alert supporting PagerDuty Incidents and Change Events.

Incidents will notify the appropriate group or user at PagerDuty as to an issue with Codefresh Pipeline.

Change Events are used to watermark Applications that exist on PagerDuty to be able to easily trace back to changes that have occurred to the Application.

Creating API Keys: https://support.pagerduty.com/docs/generating-api-keys

Below are some instructions and outcomes of setting up each type of notification.

Incident

Create API Token for step authentication

Insert the step YAML below into your pipeline, likely using hooks on_failure feature.

CreateIncident:
  type: pagerduty-alert
  arguments:
    API_TOKEN: x2392fhhgdys867gt3fd
    PAGERDUTY_ALERT_TYPE: incident
    ASSIGNEE_USER_ID: PONU62J
    FROM_EMAIL: dustin@codefresh.io
    TITLE: 'Codefresh Build Failed: ${{CF_BUILD_URL}}'
    SERVICE_ID: 87hsd2fh38gh7g

When the step is executed user will see the following Change Event in PagerDuty.

Change Event

Create Routing Key for Application

Insert the step YAML below into your pipeline after the change you want to watermark.

SubmitChangeEvent:
  type: pagerduty-alert
  arguments:
    API_TOKEN: x2392fhhgdys867gt3fd
    PAGERDUTY_ALERT_TYPE: change_event
    EVENT_SOURCE: Codefresh
    EVENT_SUMMARY: Deployment Completed

When the step is executed user will see the following Change Event in PagerDuty.