Submit Search
Upload
Iret tech labo#5 CircleCIで始めるCI/CD導入の基本と導入事例の紹介
•
0 likes
•
95 views
M
MakiMatsunaga2
Follow
2020/12/17開催、無料オンライン技術勉強会『iret tech labo #5』のLT資料
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 33
Download Now
Download to read offline
Recommended
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
More Related Content
Featured
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
Introduction to C Programming Language
Introduction to C Programming Language
Simplilearn
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software
9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com
I Rock Therefore I Am. 20 Legendary Quotes from Prince
I Rock Therefore I Am. 20 Legendary Quotes from Prince
Empowered Presentations
How to Map Your Future
How to Map Your Future
SlideShop.com
Featured
(20)
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Introduction to C Programming Language
Introduction to C Programming Language
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
I Rock Therefore I Am. 20 Legendary Quotes from Prince
I Rock Therefore I Am. 20 Legendary Quotes from Prince
How to Map Your Future
How to Map Your Future
Iret tech labo#5 CircleCIで始めるCI/CD導入の基本と導入事例の紹介
1.
CircleCIで始めるCI/CD導入の基本と 導入事例の紹介
2.
自己紹介 名前:松永 真季 所属: CI事業部
MSP開発セクション@大阪オフィス 入社: 2020年 1月入社 担当:アプリケーションエンジニア
3.
アジェンダ - CI/CDとは - CI/CDの代表サービスのCircleCIの紹介 -
導入実例と導入後の効果について
4.
CI/CDとは CI/CD テスト ビルド デプロイ ソースコードの 変更 本番環境 ステージング 環境 開発環境 反映 ソフトウェアに変更が発生するたびに テスト、ビルド、デプロイを自動化する開発手法のこと。
5.
CircleCI概要 CI/CDツール テスト ビルド デプロイ ソースコードの 変更 本番環境 ステージング 環境 開発環境 反映
6.
CircleCIの オススメポイント - SaaS型/オンプレ型選択可能なCI/CDサービス - SaaS型の場合CircleCIはクラウド上のコンテナまたはVM上で動作する →
管理コストが低い - CircleCI Runnerという自社で管理しているサーバをCircleCIのビルドサーバと して利用することが出来る機能が最近リリースされた(2020年11月)👏 - ymlファイルで手順を一括設定できる - 従量課金なので利用料には要注意 - GitHub/Bitbucketとの連携が必須
7.
料金プラン - 料金プランによって使用できる機能が異なります https://circleci.com/ja/pricing/
8.
今回はCircleCIでシステムの テスト、ビルド、デプロイ を自動化しました
9.
導入したシステムの紹介(一例) アイレットが提供する、 クラウドの導入設計から構築・運用・監視保守をするマネージドサービス MSPチームが24時間365日でサーバーを監視してお客様のインフラ環境やITシステムの安定運用を実現しています。 アラートや障害が発生した時の一次対応をするシステムに導入 明日12月18日(金)、夜8時開催!
10.
導入理由 - システム改修後のリリース作業の時間を削減したい → リリース回数も割とある(月1、2回)。効果がわかりやすそう -
リリースまでに手作業が多いのでケアレスミス発生の可能性をなくしたい
11.
導入前 ※自前のスクリプトを手動で実行1.実装 2.テスト 実装完了&テストPass 確認後にgit
commit & push ※自前のスクリプトを手動で実行 2.ビルド 自前のスクリプトを手動実行しそれぞれの環境へ反映 3.デプロイ 本番環境 ステージング 環境 開発環境 ※自前のスクリプトを手動で実行 開発時 リリース時 1.環境設定 ※自前のスクリプトを手動で実行
12.
CircleCI実行トリガー CI(自動テスト)実行トリガー - GitHub開発用featureブランチにpushした時 → テストスクリプトを自動実行 CD(自動テスト〜ビルド〜デプロイ)実行トリガー -
GitHubで特定のブランチへmergeした時 → mergeされたブランチごとにデプロイ先環境を設定
13.
導入後 ※自前のスクリプトを自動実行 実装 git push 本番環境 ステージング 環境 開発環境 開発時 リリース時 テストの結果を通知。テスト漏れがあってもすぐに気づく! git push main(master)ブランチへ マージ releaseブランチへ マージ developブランチへ マージ 変更を通知 1〜3の実行結果を通知。失敗してもすぐ気づく! 変更を通知 変更を通知 変更を通知
14.
導入効果 - 従来のリリース作業時間が約23%減 - テスト実施漏れがなくなった →
早い段階でエラーに気づく - 手作業による作業ミスの発生率0%に
15.
CircleCI導入手順
16.
事前準備 - Git Hubアカウント/レポジトリの作成 -
CircleCIアカウントの作成 - Git HubアカウントとCircleCIアカウントの連携設定
17.
事前準備
18.
Config.yml作成 - 設定は全て.circleci/config.yml に記載します。 -
CI/CDを実行する対象Gitレポジトリのルートに用意します
19.
Config.yml構成① バージョン指定(必須) ジョブを定義(必須) ジョブが動作するコンテナ環境を指定 ジョブ実行内容を記載(記載順に実行される) 【Docker hub by
CircleCI】 テストjob ビルドjob デプロイjob ジョブが動作するVM環境を指定
20.
Config.yml構成② ワークフロー(パイプライン) - ジョブの実行順を指定できる - シーケンシャル処理 -
並列処理 - ジョブを実行するgithubブランチを指定できる シーケンシャル処理 並列処理
21.
Web-UI ジョブ(クリックで詳細画面へ遷移) ワークフロー(パイプライン) 結果
22.
環境変数の設定 Project Settings >
environment-variables
23.
Config.ymlを簡潔に書く工夫 - CircleCI Orbsの使用 -
Parametersの使用 - コマンドのスクリプト化
24.
CircleCI Orbs① - config.ymlに定義する設定をパッケージングし、再利用できる仕組み -
Version :2.1以上 - Slack通知したい - AWSコマンドを叩きたい などの設定をパッケージングし 簡単に再利用できる機能。 CircleCIにて用意されている。 なくても自分で作成して登録可能。
25.
CircleCI Orbs②
26.
Parametersの使用
27.
コマンドのスクリプト化 - コマンドを複数まとめて書かず、 スクリプト化して呼び出す - 右の場合、エラー発生時原因箇所が特定できない
28.
ジョブ実行時間を短縮する工夫 - テストの並列実行 - 依存関係の再利用
29.
テストの並列実行 テストコードをCircleCIでファイル分割して並列実行してくれる 並列実行するコンテナ数を指定 分割方法
30.
依存関係の再利用 - Version 2.1以上 -
前回のビルドによるNpm モジュール などの依存関係の設定をキャッシュし、 再利用できる(保存期間15日) →ビルド時間が短くなる ※checksumで指定したファイルに変更があるとキャッシュは 再作成される(この場合package-lock.json) キャッシュがなければ作る キャッシュがあれば使う この処理がスキップできる
31.
その他便利機能 ジョブの承認機能 Web-uiで承認するまでパイプラインを一時停止 チャットによるサポート リアルタイム対応 SSHによるデバッグ コンテナに入ってデバッグ
32.
まとめ - CI/CDを導入すると開発サイクルの効率が上がる(DevOps) - 手動のルーティン作業は自動化でミスをなくすことができる -
CircleCIにはdocker imageやorbsなど便利機能が用意されているので活用
33.
ありがとうございました
Download Now