10
4

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.

CircleCIのManual ApprovalをSlackへ通知する(Orb利用)

Last updated at Posted at 2019-06-13

↓の記事でやられてることを、CircleCI v2.1の新機能であるOrbを利用して実現してみます。

準備

  1. SlackのIncomming Webhookを作成します(手順割愛)
  2. そのWebhookのURLをCircleCIの環境変数SLACK_WEBHOOK というNameで登録します
  3. config.yml で↓のように記述します
version: 2.1

orbs:
  slack: circleci/slack@3.2.0

executors:
  python3_6_1:
    working_directory: ~/repo
    docker:
      - image: circleci/python:3.6.1

jobs:
  notify-to-slack-for-approval:
    executor:
      name: python3_6_1

    steps:
      - slack/approval:
          message: "本番環境へのデプロイを承認してください"
          mentions: "here"
          color: "#F5E911"

workflows:
  build-deploy:
    jobs:
      - notify-to-slack-for-approval
      - approval:
          type: approval

Done

image.png

メモ

  • Orbはまだまだ荒削りなものが多くWebの情報が信用出来ないので公式から情報を探しましょう
    • そして公式の情報も間違っていることがあるので動かないときはOrbのコードを読みましょう
10
4
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
10
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?