A structured and opinionated Slack notification resource for Concourse. It started as a rewrite of arbourd/concourse-slack-alert-resource in Rust to add a few features, mainly reading the message from a file or being able to send shorter messages that still had a similar format.
This is an up-to-date fork of https://github.com/mockersf/concourse-slack-notifier/ with instanced pipeline support.
This work is based on https://github.com/aoldershaw/concourse-slack-notifier/tree/support-instance-vars
The message is built by using Concourse's resource metadata to show the pipeline, job, build number and a URL.
Use this resource by adding the following to the resource_types section of a pipeline config:
resource_types:
- name: slack-notifier
type: docker-image
source:
repository: baylibre/concourse-slack-notifierSee the Concourse docs for more details on adding resource_types to a pipeline config.
url: Required. Slack webhook URL.channel: Optional. Target channel where messages are posted. If unset the default channel of the webhook is used.concourse_url: Optional. The external URL that points to Concourse. Defaults to the env variableATC_EXTERNAL_URL.username: Optional. Concourse local user (or basic auth) username. Required for non-public pipelines if using alert typefixedorbrokepassword: Optional. Concourse local user (or basic auth) password. Required for non-public pipelines if using alert typefixedorbrokeca_cert: Optional. A CA certificate for the Concourse instance. This is used to validate the certificate of Concourse when the instance's certificate is signed by a custom authority (or itself).ignore_ssl: Optional. This option allows unsecure access to Concourse (not verifying certificates).disabled: Optional. This option will disable all notifications from this resource.
resources:
- name: notify
type: slack-notifier
source:
url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXXSends a structured message to Slack based on the alert type and mode.
alert_type: Optional. The type of alert to send to Slack. See Alert Types. Defaults tocustom.channel: Optional. Channel where this message is posted. Defaults to thechannelsetting in Source.message: Optional. The status message at the top of the alert. Defaults to name of alert type.message_file: Optional. The path to a file to use as message.fail_if_message_file_missing: Optional. Will fail ifmessage_fileis set but the file is missing. Defaults tofalse.color: Optional. The color of the notification bar as a hexadecimal. Defaults to the icon color of the alert type.mode: Optional. The amount of information displayed in the message. See Modes. Defaults tonormal_with_info.disabled: Optional. This notification is disabled.message_as_code: Optional. Message text will be wrapped in``` [...] ```, if message is in modenormalornormal_with_info.
basic configuration:
jobs:
plan:
- put: notifywith an alert type, a mode and a message
jobs:
plan:
- put: notify
params:
message: my job failed
mode: concise
alert_type: failed-
custom
-
success
-
failed
-
started
-
aborted
-
fixedFixed is a special alert type that only alerts if the previous build did not succeed. Fixed requires
usernameandpasswordto be set for the resource if the pipeline is not public.
-
brokeBroke is a special alert type that only alerts if the previous build succeed. Broke requires
usernameandpasswordto be set for the resource if the pipeline is not public.
Examples notifications with a messages with the different modes:


