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
Deploy from slack
Search
Hiroto Fukui
September 21, 2019
Programming
0
44
Deploy from slack
Practical guide to install a way to deploy static web site using Slash command.
Hiroto Fukui
September 21, 2019
Tweet
Share
More Decks by Hiroto Fukui
See All by Hiroto Fukui
メールアドレスを深堀りする
bary822
2
1.1k
kiba ETLで小さく始めるデータ分析基盤構築
bary822
3
190
AR_migrationの例外.pdf
bary822
0
38
GraphQLを_Rubyで気軽に試す.pdf
bary822
0
190
Other Decks in Programming
See All in Programming
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
170
Hanami and htmx
bkuhlmann
0
210
GitHub Copilotのススメ
marcy731
1
200
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
Tailwind CSSを本気でカスタマイズする方法
fsubal
14
5.3k
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
440
SIMD Parallel Programming with the Vector API
josepaumard
0
190
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
370
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
970
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
20
1.9k
Faster Mobile Websites
deanohume
299
30k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
19
1.7k
Visualization
eitanlees
136
14k
Clear Off the Table
cherdarchuk
84
310k
A Philosophy of Restraint
colly
197
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Adopting Sorbet at Scale
ufuk
68
8.6k
Gamification - CAS2011
davidbonilla
76
4.6k
The Invisible Side of Design
smashingmag
294
49k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Transcript
Slackからデプロイ Hiroto Fukui @bary822
self self.name => Hiroto Fukui self.sns => @bary822 self.titles =>
[‘app engineer’, ‘data engineer’] self.companies => [‘rakuten’, ‘grooves’] self.likes => [‘dog’, ‘camping’,’SUP‘, ruby’]
Osaka Tokyo
None
Slackからデプロイしたい
?
前提 - サービスの静的サイト - Ruby製 - https://www.crowd-agent.com/agent/ - コードはGitHub -
S3でホスティング - bundle exec middleman s3_sync -e=production でデプロイ
? S3
1. /deploy production する 2. 任意のURLにPOSTリクエストを発行 3. レスポンスに応じてメッセージを表示
? S3
AWS Lambda FaaS(Function as a Service) 1. Lambda関数がリクエストを受け付ける 2. GitHubからコードをダウンロード
3. コマンド実行 4. S3 APIを呼び出してsync(デプロイ)
? S3
API Gateway Lambda S3
API Gateway Lambda S3
None
API Gateway Lambda CircleCI S3
API Gateway Lambda CircleCI S3
3秒ルール - Slashコマンドは3秒以内に何らかのメッセージを返す必要がある - それを超えるとエラーメッセージが表示される リクエストを受け取ると とりあえず何かを返すのが吉
API Gateway Lambda 1st CircleCI Lambda 2nd S3
リクエストがLambdaに届いた時にとりあえず返す CircleCI APIから200が返ってきた時に返す
よくあるかもしれない質問
Slashコマンドが呼ぶAPIの認証方法 - Slashコマンド毎にユニークなトークンがヘッダーに入ってPOSTされる - API Gatewayでそれを検証
Lambdaの無料枠内で収まるのでは - 多分収まる - デプロイするのは開発者ではない - マーケティングの人 - デプロイ回数をコントロールできない前提があった
CIに入れるとpushする度にデプロイされるのでは - DEPLOY という環境変数を見るようにした - Lambdaから呼び出す時のみ DEPLOY=true を設定 - CircleCI
APIではジョブ実行時の環境変数をパラメーターに指定できる