{"componentChunkName":"component---src-templates-post-template-js","path":"/posts/ci-services","result":{"data":{"markdownRemark":{"id":"ba8129a4-6cd8-56ed-99cf-2564c6a12951","html":"<p>今まで仕事や勉強で様々な CI サービスをさわってきたので、様々な CI サービスを比較し、どのように選定すべきか、どのように学習すべきかをまとめました。</p>\n<p>※ この記事は 2020/10/6 時点の情報なのでご注意ください</p>\n<h2 id=\"ci-サービスの分類\" style=\"position:relative;\"><a href=\"#ci-%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%81%AE%E5%88%86%E9%A1%9E\" aria-label=\"ci サービスの分類 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CI サービスの分類</h2>\n<p>CI サービスといっても色々な種類があります。</p>\n<p>この記事では独自に 5 つに分類しました。</p>\n<ul>\n<li>\n<p>SaaS - CI 専用サービス系</p>\n<ul>\n<li>例) CircleCI, Travis CI</li>\n</ul>\n</li>\n<li>\n<p>SaaS - Git サービス系</p>\n<ul>\n<li>例) GitLab CI, GitHub Actions</li>\n</ul>\n</li>\n<li>\n<p>SaaS - パブリッククラウド系</p>\n<ul>\n<li>例) AWS CodeBuild, Google Cloud Build</li>\n</ul>\n</li>\n<li>\n<p>SaaS - Mobile 系</p>\n<ul>\n<li>例) Bitrise</li>\n</ul>\n</li>\n<li>\n<p>OSS</p>\n<ul>\n<li>例) Jenkins, Concourse, Drone</li>\n</ul>\n</li>\n</ul>\n<p>上に例として挙げた 10 のサービス (ツール) を簡単に比較していき、その後どれを使うべきか、どう学習すべきかを説明していきます。\n同時に、各サービスの解説書も紹介していきます。</p>\n<h2 id=\"ci-サービスの比較\" style=\"position:relative;\"><a href=\"#ci-%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%81%AE%E6%AF%94%E8%BC%83\" aria-label=\"ci サービスの比較 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CI サービスの比較</h2>\n<h3 id=\"saas---ci-専用サービス系\" style=\"position:relative;\"><a href=\"#saas---ci-%E5%B0%82%E7%94%A8%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E7%B3%BB\" aria-label=\"saas   ci 専用サービス系 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SaaS - CI 専用サービス系</h3>\n<h4 id=\"circleci\" style=\"position:relative;\"><a href=\"#circleci\" aria-label=\"circleci permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CircleCI</h4>\n<p>CircleCI は非常によく使われている CI サービスです。\nGitHub Actions の登場で状況が変わっているかもしれませんが、少なくとも <strong>GitHub Actions 登場以前はたくさんの事例を聞きました</strong>。</p>\n<p>GitHub との連携を設定し、YAML ファイルには実行したいシェルコマンドを順に書いていくというスタンダードな使い方です。</p>\n<p><strong>public リポジトリか private リポジトリかによらず、ある程度の無料枠があります</strong>。</p>\n<p>私は未読ですが、2020/9/14 に書籍『<a href=\"https://amzn.to/2T9Xi0h\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">CircleCI実践入門──CI/CDがもたらす開発速度と品質の両立</a>』が発売されました。興味がある方は読んでみてもいいかもしれません。</p>\n<p><a href=\"https://www.amazon.co.jp/dp/B08H51JHS1/ref=as_li_ss_il?ie=UTF8&linkCode=li1&tag=oshimayuki0d-22&linkId=895c75403c1c7f539b69665fb763ef4c&language=ja_JP\" target=\"_blank\"><img border=\"0\" src=\"//ws-fe.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B08H51JHS1&Format=_SL110_&ID=AsinImage&MarketPlace=JP&ServiceVersion=20070822&WS=1&tag=oshimayuki0d-22&language=ja_JP\" ></a><img src=\"https://ir-jp.amazon-adsystem.com/e/ir?t=oshimayuki0d-22&amp;language=ja_JP&amp;l=li1&amp;o=9&amp;a=B08H51JHS1\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"></p>\n<h4 id=\"travis-ci\" style=\"position:relative;\"><a href=\"#travis-ci\" aria-label=\"travis ci permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Travis CI</h4>\n<p>CircleCI と似たような使い方のサービスです。</p>\n<p>CircleCI との使い分けは、無料枠の違いでなされることも多いと思います。\nCircleCI は private リポジトリ含めた無料枠がありますが、並列実行などに制限があります。\n一方、Travis CI は <strong>OSS なら完全無料</strong>になっています。</p>\n<p>Travis CI は OSS 版もあるので、自分たちのサーバに構築することも一応できます。</p>\n<h3 id=\"saas---git-サービス系\" style=\"position:relative;\"><a href=\"#saas---git-%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E7%B3%BB\" aria-label=\"saas   git サービス系 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SaaS - Git サービス系</h3>\n<h4 id=\"gitlab-ci\" style=\"position:relative;\"><a href=\"#gitlab-ci\" aria-label=\"gitlab ci permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>GitLab CI</h4>\n<p>GitLab に付属する CI サービスです。</p>\n<p>GitLab 自体 SaaS 版と OSS 版があるので、SaaS として使うこともできますし、オンプレミスに立てることも可能です。</p>\n<p><strong>GitLab のリポジトリに YAML ファイルをコミットするだけで動き出す</strong>ので、Git との連携が非常に簡単です。\nYAML ファイルを書く感覚は CircleCI や Travis CI と近いです。</p>\n<p>GitLab 自体非常に高機能なので、『<a href=\"https://amzn.to/3w5xYqF\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GitLab実践ガイド</a>』などで大枠を学んでみてもいいかもしれません。</p>\n<p><a href=\"https://www.amazon.co.jp/dp/B079DL362C/ref=as_li_ss_il?ie=UTF8&linkCode=li1&tag=oshimayuki0d-22&linkId=ddcb22d0c89db352d3b54f8c57d5dedb&language=ja_JP\" target=\"_blank\"><img border=\"0\" src=\"//ws-fe.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B079DL362C&Format=_SL110_&ID=AsinImage&MarketPlace=JP&ServiceVersion=20070822&WS=1&tag=oshimayuki0d-22&language=ja_JP\" ></a><img src=\"https://ir-jp.amazon-adsystem.com/e/ir?t=oshimayuki0d-22&amp;language=ja_JP&amp;l=li1&amp;o=9&amp;a=B079DL362C\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"></p>\n<h4 id=\"github-actions\" style=\"position:relative;\"><a href=\"#github-actions\" aria-label=\"github actions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>GitHub Actions</h4>\n<p>GitHub Actions は 2018 年に発表された非常に新しい CI サービスです。</p>\n<p>GitHub Actions の非常に特徴的な点は、<strong>各ステップのアクションとして GitHub に公開されている様々なアクションを指定可能</strong>なことです。\n世界中のエンジニアが作ったアクションを使いまわすことができ、GitHub の「Social Coding」というキャッチコピーを体現した CI サービスだと思います。\n(CircleCI にも「Orb」というジョブなどの構成要素を共有する機能はあります)</p>\n<p>GitHub Actions は何より、GitHub との連携が非常に簡単です。<strong>CircleCI と異なり、GitHub に YAML ファイルをコミットするだけで自動的にワークフローが登録されます</strong>。CircleCI では GUI で GitHub との連携を設定する必要があるので、<strong>GitHub Actions の方が CircleCI よりもセットアップが容易</strong>です。</p>\n<p><strong>public リポジトリなら完全無料で、private リポジトリでも無料枠がある</strong>ので、これまで CircleCI や TravisCI を採用していた場面で GitHub Actions が採用されることが増えていきそうです。</p>\n<p>こちらも私は未読ですが、『<a href=\"https://amzn.to/3cIYgYn\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GitHub Actions 実践入門</a>』という書籍もあります。</p>\n<p><a href=\"https://www.amazon.co.jp/dp/B08B1873L5/ref=as_li_ss_il?ie=UTF8&linkCode=li1&tag=oshimayuki0d-22&linkId=fd27fe47dccc37988772d0466d043000&language=ja_JP\" target=\"_blank\"><img border=\"0\" src=\"//ws-fe.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B08B1873L5&Format=_SL110_&ID=AsinImage&MarketPlace=JP&ServiceVersion=20070822&WS=1&tag=oshimayuki0d-22&language=ja_JP\" ></a><img src=\"https://ir-jp.amazon-adsystem.com/e/ir?t=oshimayuki0d-22&amp;language=ja_JP&amp;l=li1&amp;o=9&amp;a=B08B1873L5\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"></p>\n<h3 id=\"saas---パブリッククラウド系\" style=\"position:relative;\"><a href=\"#saas---%E3%83%91%E3%83%96%E3%83%AA%E3%83%83%E3%82%AF%E3%82%AF%E3%83%A9%E3%82%A6%E3%83%89%E7%B3%BB\" aria-label=\"saas   パブリッククラウド系 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SaaS - パブリッククラウド系</h3>\n<h4 id=\"aws-codebuild\" style=\"position:relative;\"><a href=\"#aws-codebuild\" aria-label=\"aws codebuild permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AWS CodeBuild</h4>\n<p>AWS が提供する CI サービスです。</p>\n<p>YAML ファイルにシェルコマンドを書いていく方式なので、使用感は CircleCI・Travis CI・GitLab CI と近いです。</p>\n<p>CodePipeline と組み合わせて CI / CD パイプラインを構築する場合もあります。\n個人的には AWS アカウントを開発・本番と分けた際のクロスアカウントアクセス設定が複雑になりがちな CodePipeline は使わず、CodeBuild とシェルスクリプトで頑張るのも悪くないと思います。</p>\n<h4 id=\"google-cloud-build\" style=\"position:relative;\"><a href=\"#google-cloud-build\" aria-label=\"google cloud build permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Google Cloud Build</h4>\n<p>設定方法はちょっとクセがあり、<strong>1 つ 1 つのステップで実行環境のコンテナイメージと実行するコマンドを指定していく</strong>ことになります。\n例えば、あるステップで npm run build コマンドを実行し、次のステップで docker build コマンドを実行するような場合、最初のステップでは Node.js のコンテナを使い、次のステップでは Docker のコンテナを使うことになります。</p>\n<p>なので、<strong>コンテナを使い慣れていないと使いこなすのは難しい</strong>です。\nなんでもコンテナ上で実行したい人は大好きかもしれません。</p>\n<p>『<a href=\"https://amzn.to/2T6C0jZ\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GCPの教科書II 【コンテナ開発編】 KubernetesとGKE、Cloud Run、サービスメッシュを詳解</a>』という書籍で、1 章を割いて解説されているので、Google Cloud Build の雰囲気を知るために手に取ってもよさそうです。</p>\n<p><a href=\"https://www.amazon.co.jp/dp/B088LZGPM5/ref=as_li_ss_il?ie=UTF8&linkCode=li1&tag=oshimayuki0d-22&linkId=d69f7f9c480e81a8cce7f7acc7bf536a&language=ja_JP\" target=\"_blank\"><img border=\"0\" src=\"//ws-fe.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B088LZGPM5&Format=_SL110_&ID=AsinImage&MarketPlace=JP&ServiceVersion=20070822&WS=1&tag=oshimayuki0d-22&language=ja_JP\" ></a><img src=\"https://ir-jp.amazon-adsystem.com/e/ir?t=oshimayuki0d-22&amp;language=ja_JP&amp;l=li1&amp;o=9&amp;a=B088LZGPM5\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"></p>\n<h3 id=\"saas---mobile\" style=\"position:relative;\"><a href=\"#saas---mobile\" aria-label=\"saas   mobile permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SaaS - Mobile</h3>\n<h4 id=\"bitrise-系\" style=\"position:relative;\"><a href=\"#bitrise-%E7%B3%BB\" aria-label=\"bitrise 系 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Bitrise 系</h4>\n<p>Bitrise は<strong>モバイルアプリ</strong>の CI サービスです。</p>\n<p>前提として、iOS のビルドは macOS でしかできないうえ、macOS はライセンス的に Apple のデバイス上でしか動かせません。\nそのため、iOS のビルドが実行できる CI サービスは限られています。\nCircleCI や GitHub Actions も macOS でのビルドに対応していますが、Bitrise が料金面で優れています。</p>\n<p>設定方法は独特で、各ステップで事前に用意されたアクションを実行していくイメージです。</p>\n<p>モバイルアプリのビルド・デプロイ自体 Web とはかなり異なるので、CI を組む際はその知識が必要になります。</p>\n<h3 id=\"oss\" style=\"position:relative;\"><a href=\"#oss\" aria-label=\"oss permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>OSS</h3>\n<h4 id=\"jenkins\" style=\"position:relative;\"><a href=\"#jenkins\" aria-label=\"jenkins permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Jenkins</h4>\n<p>Jenkins は最も有名な CI ツールだと思います。\nCI の SaaS がよく使われるようになるまでは最も使われていたのではないでしょうか。</p>\n<p>しかし、最近は Jenkins を採用するケースは減ってきています。\n理由として、Jenkins は<strong>ジョブの設定を YAML などのテキストとして記述・管理する Pipeline as Code が苦手</strong>です。\n一応 Jenkins Pipeline というものを使えば DSL でパイプラインを記述できますが、他の CI サービス (ツール) と比べて記法の学習コストが高い上、Jenkins Pipeline では簡単に実現できない設定があります。</p>\n<p>このように、Jenkins では GUI で設定しなくてはならない箇所ができるなどして、最終的にはチーム内に Jenkins 設定担当者 (いわゆる Jenkins おじさん) が生まれることになりやすく、最近は敬遠されています。</p>\n<h4 id=\"concourse・drone\" style=\"position:relative;\"><a href=\"#concourse%E3%83%BBdrone\" aria-label=\"concourse・drone permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Concourse・Drone</h4>\n<p>Concourse・Drone は YAML でパイプラインを記述するタイプの OSS の CI ツールです。</p>\n<p>どうしても CI の SaaS が使えないという制限がある場合に採用を検討することになります。</p>\n<h2 id=\"選定方法\" style=\"position:relative;\"><a href=\"#%E9%81%B8%E5%AE%9A%E6%96%B9%E6%B3%95\" aria-label=\"選定方法 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>選定方法</h2>\n<p>まず、<strong>特に制約がない限りは SaaS</strong> を使うことをおすすめします。</p>\n<p>どうしても SaaS が禁止されているなどして<strong>自前で CI サービスを立てる場合、Concourse や Drone、GitLab CI をオススメします</strong>。\nJenkins は Pipeline as Code が苦手なため、あまりおすすめしません。</p>\n<p>SaaS を使うとして、<strong>iOS のビルドがある場合は Bitrise</strong> が有力候補になります。\nとはいえ、CircleCI や GitHub Actions に慣れていればそちらを使ってもいいかもしれません。</p>\n<p>上記の例外的なケースを除いた多くの場合、<strong>アプリケーションのプラットフォームが提供する CI サービス (AWS CodeBuild、Google Cloud Build、Azure DevOps、Heroku CI など) を選択するか、アプリケーションのプラットフォームと無関係な CI サービス (GitHub Actions、GitLab CI、CircleCI、Travis CI など) を選択するか</strong>が分岐点になります。</p>\n<p>これら 2 つの大きな違いは、<strong>自動デプロイのためにアクセスキーを払い出す必要があるかないか</strong>です。\n前者 (AWS CodeBuild など) の CI サービスであれば、IAM Role のような機能によってアクセスキー不要で自動デプロイが可能です。\n後者 (GitHub Actions など) の CI サービスの場合、自動デプロイを実施するためにはアクセスキーのような機密情報を払い出す必要があるので、それを許容できるかが選択可否に影響します。</p>\n<p>GitHub Actions、GitLab CI、CircleCI、Travis CI からの選択には、無料枠の違いに注意が必要です。\n<strong>public リポジトリの場合、GitHub Actions、GitLab CI、TravisCI は完全無料で、CircleCI もある程度まで無料</strong>で使えます。<strong>private リポジトリの場合、GitLab CI は完全無料で、GitHub Actions、GitLab CI、CircleCI はある程度まで無料</strong>となります。</p>\n<p>これらを踏まえて、あとは好みのツールを選びましょう。\nどうしてもどれを使うべきか迷った方は、<strong>YAML ファイルをコミットするだけでセットアップできる GitHub Actions か GitLab CI</strong> から使い始めてみるといいのではないでしょうか。</p>\n<h2 id=\"学習方法\" style=\"position:relative;\"><a href=\"#%E5%AD%A6%E7%BF%92%E6%96%B9%E6%B3%95\" aria-label=\"学習方法 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>学習方法</h2>\n<p>最後に、CI サービス (ツール) の学習方法です。</p>\n<p><strong>まずはスタンダードな YAML でシェルコマンドを記述するタイプ</strong>の CircleCI、Travis CI、GitLab CI, AWS CodeBuild あたりをさわってみるといいと思います。\nGitHub Actions も、シェルコマンドを書き並べるところから簡単に使い始めることができます。</p>\n<p>CI で必ずぶつかる、<strong>node_modules などをキャッシュして高速化</strong>したいという課題を解決する機能がどの CI サービスにも必ずあるので、そのくらいまではさわってみるといいと思います。</p>\n<p>その後、<strong>GitHub Actions で公開されているアクションを使ってみたり、コンテナについて学習した上で Google Cloud Build をさわってみる</strong>といいかもしれません。</p>\n<p><strong>iOS エンジニアなら Bitrise</strong> をさわってみるべきです。</p>\n<p>さらに、<strong>Kubernetes を使っている場合は、Argo CI (CD) や Spinnaker</strong> といったツールもよく使われているので、キャッチアップしてみるとよさそうです。</p>\n<p>実際に開発を進める上では、CI と近い環境を開発者が使っていることも重要です。\nそのため、<strong>コンテナや ◯◯env などを使った開発環境の統一</strong>にも取り組むのもおすすめです。</p>","fields":{"slug":"/posts/ci-services","tagSlugs":["/tag/ci/","/tag/devops/"],"autoRecommendPosts":["udemy-cicd-with-github-actions","udemy-aws-container","cicd-conference-2021","how-to-study-aws-basics"]},"frontmatter":{"date":"2020-07-11T04:47:57.888Z","description":"今まで仕事や勉強で様々な CI サービスをさわってきたので、様々な CI サービスを比較し、どのように選定すべきか、どのように学習すべきかをまとめました。\n独自に 5 つに分類した 10 のサービス (ツール) を簡単に比較していき、その後どれを使うべきか、どう学習すべきかを説明していきます。","tags":["ci","devops"],"title":"CI 大好きエンジニアによる CI サービス (ツール) の分類・比較と選定方法・学習方法","socialImage":null,"recommendPosts":["https://www.kanzennirikaisita.com/posts/anyenv-asdf-docker","https://www.kanzennirikaisita.com/posts/software-developer-books-index"]}}},"pageContext":{"slug":"/posts/ci-services"}},"staticQueryHashes":["251939775","3942705351","401334301"]}