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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Transcript
11 slides
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/ ご清聴ありがとうございました
More Decks by valerauko
See All by valerauko
Reitit使ってみた
valerauko
0
410
分解に救われる
valerauko
0
110
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
420
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
120
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
330
SODA - FACT BOOK(EN)
sodainc
1
280
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
110
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
230
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
810
将来の標準フォーマッター?ktfmtを深堀る
t45k
0
250
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.9k
Everyday Curiosity
cassininazir
0
420
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How to Ace a Technical Interview
jacobian
280
24k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
640
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
600
The Pragmatic Product Professional
lauravandoore
37
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
Well, that’s weird…
csswizardry
1
210