Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

vindaloopoo/wercker-kelevra-slack-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wercker status

wercker-kelevra-slack-notifier

A wercker after-step slack notifier written in bash and curl. Make sure you create a Slack webhook first (see the Slack integrations page to set one up).

This is based on the official build step. Why? as we have added the notify_on option failed_or_passed_after_failed.

Options

Options are applied via organisation environment, pipeline environment or the wercker.yml.

Option Description Environment
url The Slack webhook URL (REQUIRED)
The url parameter is the slack webhook that wercker should post to. You can create an incoming webhook on your slack integration page.
SLACK_NOTIFIER_URL
channel The Slack channel (excluding #) SLACK_NOTIFIER_CHANNEL
username Username of the notification message. i.e. who it is sent by. SLACK_NOTIFIER_USERNAME
icon_url A url that specifies an image to use as the user avatar icon in Slack SLACK_NOTIFIER_ICON_URL
notify_on If set. Possible values failed, passed or failed_or_passed_after_failed.
Default is all.
  • If set to failed, it will only notify on failed builds or deploys.
  • If set to passed, it will only notify on passed builds or deploys.
  • If set to failed_and_passed_after_failed, it will only notify on failed builds/deploys or passed after a failed. This requires the wercker_token option.
SLACK_NOTIFIER_NOTIFY_ON
branch If set, it will only notify on the given branch SLACK_NOTIFIER_BRANCH
wercker_token This is a wercker API token that can access the application.
Required for thenotify_on value failed_or_passed_after_failed.
SLACK_NOTIFIER_WERCKER_TOKEN

Examples

Some examples

Simple

build:
  after-steps:
    - kingsquare/kelevra-slack-notifier:
        url: $SLACK_URL
        channel: notifications
        username: myamazingbotname
        branch: master

SLACK_URL is set in the pipeline or organisation environment.

Use organisation defaults for easiest project integration

For easiest integration in to your application's wercker.yml add options as environment variables to your organisation. Then you can just:

build:
  after-steps:
    - kingsquare/kelevra-slack-notifier

notify on failed or passed when previous failed

build:
  after-steps:
    - kingsquare/kelevra-slack-notifier
      notify_on: failed_or_passed_after_failed

Testing

Using the wercker-cli

License

The MIT License (MIT)

Releases

No releases published

Packages

No packages published

Languages