Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Slack-Ops始めました 初心者向け "slack-notifier" の基本
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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.3k
「確認画面」ベストプラクティス
strviola
0
560
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
300
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
1
150
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
130
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
270
気持ちぃ〜角丸 Squircle
ryu1013
0
320
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
290
残高管理から台帳サービスへの進化
artoy
1
210
パスワード再設定メールのURLについて知っておこう
uyuki234
0
170
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
820
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
160
AmebaブログはKMPから卒業します
kmars0605
0
210
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Technical Leadership for Architectural Decision Making
baasie
3
610
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
640
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Designing for Timeless Needs
cassininazir
1
530
Being A Developer After 40
akosma
92
590k
Facilitating Awesome Meetings
lara
57
7.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
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ಋೖΰʔϧ͡Όͳ͍ɺελʔτͩ