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
CIにどこまで任せるのか?
Search
valerauko
May 28, 2019
Programming
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CIにどこまで任せるのか?
CircleCIを使ってサーバーへのデプロイをしてみた経験談。CIとCDの境目がどこにあるのか、どの時点で重要になるのかを考える。
valerauko
May 28, 2019
More Decks by valerauko
See All by valerauko
Reitit使ってみた
valerauko
0
410
分解に救われる
valerauko
0
110
Other Decks in Programming
See All in Programming
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
ActionController meets Protocol Buffers
sorah
0
520
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
640
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
sbt 2.0: takeoff
eed3si9n
0
160
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
JIS keyboard support in Omarchy
lef237
0
110
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Designing for Timeless Needs
cassininazir
1
530
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Designing for humans not robots
tammielis
254
26k
WENDY [Excerpt]
tessaabrams
14
40k
Thoughts on Productivity
jonyablonski
76
5.4k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
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/ ご清聴ありがとうございました