LoginSignup
32
36

More than 5 years have passed since last update.

werckerからslackにビルド結果のnotificationを送る

Posted at

一応ここに全部書いてある

Slack Notifications!

slackのtoken取得

  • トークンの取得はIncoming WebHooksから行う

https://各ドメイン.slack.com/services/new/incoming-webhookから

  1. nortification送りたいチャンネルを選択し
  2. Add Incoming WebHooksをクリック

add_incoming.png

  • トークンが作成されるのでコピー
  1. サイドバーのTOKENと書いてある箇所にtokenが表示されてるのでコピー

token.png

werckerのtoken設定

  • ApplicationのPipelineにtokenをペーストする
  1. ENVIRONMENT VARIABLEに適当な名前を付ける
    • ENVIRONMENT VARIABLEで付けた名前はwercker.yml内で変数として使用できる
  2. textvalueにコピーしたtokenをペースト
  3. protectedにチェックをしておく

wercker.png

wercker.ymlに必要な記述を行ってビルド

今回はwantedlyの方が作ったstep-pretty-slack-notifyというのを使用している

記述はこんな感じ。適宜修正してください

    after-steps:
        - wantedly/pretty-slack-notify:
            team: foobar
            token: $SLACK_API_TOKEN
            channel: general

こんな感じで通知されます

result.png

32
36
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
36