Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Slack-Ops始めました 初心者向け "slack-notifier" の基本
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
strviola
January 15, 2020
Programming
85
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Slack-Ops始めました 初心者向け "slack-notifier" の基本
strviola
January 15, 2020
More Decks by strviola
See All by strviola
安定したFeature Specを助ける3つの処方箋
strviola
0
1.2k
「確認画面」ベストプラクティス
strviola
0
560
Other Decks in Programming
See All in Programming
AIの中の人になってみる
htkym
0
170
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
170
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
470
業務時間外もAIに働いてもらう話
colorful12
3
10k
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
600
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
アクセシビリティから考える情報設計
high_g_engineer
0
300
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
560
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
100
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
自分的「カンファレンスの楽しみ方」
syumai
0
190
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Documentation Writing (for coders)
carmenintech
77
5.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
It's Worth the Effort
3n
188
29k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
sira's awesome portfolio website redesign presentation
elsirapls
0
410
The Curse of the Amulet
leimatthew05
2
14k
Typedesign – Prime Four
hannesfritz
42
3.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Transcript
4MBDL0QT͡Ί·ͨ͠ ॳ৺ऀ͚TMBDLOPUJpFSͷجຊ ϦϯΧʔζגࣜձࣾླཽଠ
ຊͷ࣍ TMBDLOPUJpFSHFNͷհ ॳظઃఆ "1*ͷհ 4MBDL0QTͷ͋Δࣄ
·ͱΊͱࠓޙͷ՝
TMBDLOPUJpFSHFNͷհ w IUUQTHJUIVCDPNTUFWFOPTMPBOTMBDLOPUJpFS w ཁ͢Δʹ)BTIΛ+40/ʹͯ͠)5511045ͯ͘͠ΕΔ # Gemfile gem 'slack-notifier' #
test.rb require 'slack-notifier' notifier = Slack::Notifier.new('WEBHOOK_URL') notifier.ping 'Hello World' # POST https://hooks.slack.com/services/... # Content-type: application/json # { "text": "Hello World" }
ॳظઃఆ w 8FCIPPL63-ͷऔಘ w IUUQTTMBDLDPNBQQT"'9%6";JODPNJOHXFCIPPLTʹΞΫηε w ϫʔΫεϖʔεɺߘઌνϟϯωϧͳͲઃఆ w 63-ઃఆը໘͔Β͍ͭͰ֬ೝߋ৽Մೳ
ॳظઃఆ w 8FCIPPL63-ͷอଘ w DPOpHTFDSFUTZNMFOD͕ແ w ڞ௨Ϋϥε͔Βݺͼग़͠ ฐࣾ"QQMJDBUJPO3FDPSE
w BUUBDINFOUT"1*ʹ͢+40/ # app/models/application_record.rb def slack_webhook_url Rails.application.secrets.slack_webhook_url end def slack_post!(attachments:, webhook_url: slack_webhook_url, username: 'LFB bot') return if webhook_url.blank? notifier = Slack::Notifier.new(webhook_url, username: username) notifier.post attachments: attachments end
"1*ͷհ color pretext title title_link fields[0] fields[1] footer title
title value value
"1*ͷհ # app/models/contact.rb def slack_notify!(host, title: '͓٬༷͔Β͍߹Θ͕ͤ͋Γ·ͨ͠ɻ') url_helper =
Rails.application.routes.url_helpers attachment = { color: '#1155A7', pretext: '<!channel>', title: title, title_link: url_helper.system_managers_contact_url(self, host: host), fields: [ { title: 'ۜߦ໊', value: Bank.current.name }, { title: '͓٬༷ࢯ໊', value: "#{user.name}༷" } ], footer: "#{Rails.env} environment" } slack_post! attachments: [attachment] end
·ͱΊ w TMBDLOPUJpFSHFNͷհ w 8FCIPPL63-ͷऔಘํ๏ w "1*ͷհ w ࠓޙͷ՝ w
ϋοϐʔʹͳΕΔ4MBDL0QT ͍߹ΘͤରԠ͚ͩͩͱؾ͕໓ೖΔ 4MBDLಋೖΰʔϧ͡Όͳ͍ɺελʔτͩ