2
1

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 5 years have passed since last update.

CircleCI2.1 Orb入門

Last updated at Posted at 2019-09-23

環境

  • CircleCI version 2.1
  • Slack Orb 3.3.0

やりたいこと

CircleCIの特定のJob(デプロイ等)の結果(成功 / 失敗)をSlackに通知したい。

設定

  • Slack上で、通知用のチャンネルを作成する。

  • Slack上で、Incomming Webhookの設定を行う。

  • CircleCI上で、該当プロジェクトのEnvironment Variablesに、Incomming Webhookの設定画面で取得したWebhook URLSLACK_WEBHOOKとして設定する。

  • CircleCIのconfigを設定する(以下、必要な箇所のみ抜粋)。

    • stepsの最後に、slack/statusを設定する。
    • slack/statusの他に、slack/approvalslack/notifyも設定できる。
.circleci/config.yml
version: 2.1

orbs:
  slack: circleci/slack@3.3.0

jobs:
  :
  deploy_to_staging:
    executor: default
    steps:
      :
      - slack/status:
          mentions: channel # mention先を指定。複数ユーザ設定時は、"USER1,USER2,USER3"とする。

参考URL

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?