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
CIにどこまで任せるのか?
Search
valerauko
May 28, 2019
Programming
0
240
CIにどこまで任せるのか?
CircleCIを使ってサーバーへのデプロイをしてみた経験談。CIとCDの境目がどこにあるのか、どの時点で重要になるのかを考える。
valerauko
May 28, 2019
Tweet
Share
More Decks by valerauko
See All by valerauko
Reitit使ってみた
valerauko
0
390
分解に救われる
valerauko
0
100
Other Decks in Programming
See All in Programming
AWS発のAIエディタKiroを使ってみた
iriikeita
1
180
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
270
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
290
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
210
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
3.8k
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
320
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
100
為你自己學 Python - 冷知識篇
eddie
1
350
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
310
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
140
アセットのコンパイルについて
ojun9
0
120
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
A Tale of Four Properties
chriscoyier
160
23k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Documentation Writing (for coders)
carmenintech
74
5k
Automating Front-end Workflow
addyosmani
1370
200k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
Transcript
CIにどこまで任せるのか? CI と CD の境目を探ってみたお話
introduction.yaml version: 2.1 executors: balint-erdos: environment: TECH: ["clojure", "kafka", "kubernetes"]
links: - https://balint.erdos.tech - https://github.com/valerauko tags: ["craft beer", "alpinism", "music"] working_directory: /tokyo jobs: studist: executor: balint-erdos environment: LANG: ["ruby", "javascript", "clojure"] steps: - tech lead enjin: executor: balint-erdos environment: LANG: ["ruby", "javascript", "go"] steps: - founding member
CircleCIとの出会い • スタディスト入社時( 2017 年) • ネイティブアプリのビルドに使用 • 当時ウェブの CI
がなかった • 開発環境を Vagrant から Docker に したい動きがあった
最初の試み: docker-composeそのままで • 開発環境を Docker に移住 • docker-compose.yml をそのままで CI
の環境として使う プラス • 自動テストができた マイナス • 遅い。とても。 • デプロイもやってもらいたい ... - run: name: Create test DB command: | docker-compose -f .circleci/compose.yml run teachme_web bundle exec rake db:create test docker-compose -f .circleci/compose.yml run teachme_web bundle exec rake db:migrate test docker-compose -f .circleci/compose.yml run teachme_web bundle exec rake db:seed test - run: name: Run rspec command: docker-compose -f .circleci/compose.yml run teachme_web bundle exec rspec
500倍 自動テストはいいぞ テストの量がまさかの
デプロイやってみよう • AWS の EC2 へデプロイ • CodeDeploy とかは備わってない プラス
• 自動デプロイできた! マイナス • ステージング 1 台のみ • すごく脆い 1. テスト走らせる 2. JS などのプリコンパイル走らせる 3. コミットして GitHub へ push 4. aws-cli でサーバーへ ssh 許可 5. ssh してサーバー上の deploy.sh 実行
とりあえずはやく! • docker-compose から CircleCI の設定に切り替え プラス • キャッシュが効く •
いくらでも平行できる マイナス • 設定の 2 重管理 主なポイント • YAML の alias をいっぱい使う • 並列化できる処理を全部 ◦ Rails のテスト ◦ Vue のテスト ◦ ドキュメントのコンパイル ◦ JS などのコンパイル • その中でもさらに並列 ◦ circleci tests glob ◦ circleci tests split
やってみたこと workspace で加速 • うまく行かず • 容量が大きすぎて結局インストー ルをそれぞれで走らせるよりも遅 くなったり executor
や command で共通化 • alias よりずっときれいになった
CIはイメージのビルドま でにしましょう
結論 デプロイは専用ツールに任せたい CircleCI から SSH でできるのは • 1 台のサーバー •
IP が決まっている やってもいいと思うのは • CD 入れるのもったいないぐら い小さなプロジェクト • とりあえずステージングの一台 だけでもやりたい時 CircleCD はいつかくるかな ... ?
仲間絶賛募集中! https://www.wantedly.com/companies/studist/ ご清聴ありがとうございました