0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Bitriseのslack通知をyamlで設定する

0
Posted at

WebHookの設定

Bitriseからslackに投稿できるようにWebHookを設定します。

まずは、slackを開いて、incoming WebHookを設定し、WebHook URLを取得します。
こちらのURLからできます。https://slack.com/services/new/incoming-webhook

次に、WebHook URLを環境変数に設定します。
BitriseのWorkflowEditorを開き、secrets タブを選択
image.png

Add new ボタンを押して先程取得したWebHook URLを保存します。
image.png

bitrise.yamlの設定

テスト実行のあとに以下を追加するだけです。

これにより、テストが成功しても失敗してもslackに通知が飛びます。

    - slack@3:
        title: Slack Notification
        is_always_run: true
        inputs:
        - webhook_url: $SLACK_WEBHOOK_URL

通知が多すぎてうっとおしい場合は、run_if: .IsBuildFailed をつけると失敗した場合にだけ通知が飛ぶようにすることができます。(Documents: IsBuildFailed, is_always_run)

    - slack@3:
        title: Slack Notification
        is_always_run: true
        run_if: .IsBuildFailed
        inputs:
        - webhook_url: $SLACK_WEBHOOK_URL
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?