🦊

GitLab CI/CD vs CircleCI

2018/09/26に公開約4,800字

はじめに

GitLab CI/CD と CircleCI の違いを比較する記事です。

GitLab CI/CD って何?

https://about.gitlab.com/features/gitlab-ci-cd/

GitLab has integrated CI/CD pipelines to build, test, deploy, and monitor your code
Rated #1 in the Forrester CI Wave™

Forrester に認められた No.1 CI サービス。

GitLab supports development teams with a well-documented installation and configuration processes, an easy-to-follow UI, and a flexible per-seat pricing model that supports self service. GitLab’s vision is to serve enterprise-scale, integrated software development teams that want to spend more time writing code and less time maintaining their tool chain

Forrester のレポートによると、整備されたドキュメントや使いやすい UI、GitLab のビジョンが賞賛されています。

GitLab への移行で他の CI サービス使っているというケースは考えられますが、GitLab を使っているなら GitLab CI/CD を選択するのがおそらく一般的です。

CircleCI って何?

https://circleci.com/product/

Power, Flexibility, and Control
CircleCI gives your team more speed and configurability than ever before.

他サービスとの柔軟な連携や容易な設定が売りとしています。
Forrester には GitLab と同じく Leader に認定されています。

https://www2.circleci.com/circleci-forrester-wave-leader-2017.html

Organizations striving to be lean and stay lean will appreciate the simplified, nearly zero-maintenance approach CircleCI provides. Existing customers will appreciate the new features of CircleCI 2.0 that appear to completely address all the top asks that customers are looking for.

Forrester のレポートによると、ほぼ保守が不要な点と 2.0 の新機能が賞賛されています。

GitHub であれば Travis CI に続いて 2 番目のシェア率と利用者も多いようです。

32575895-ea563032-c49a-11e7-9581-e05ec882658b.png

参考:https://blog.github.com/2017-11-07-github-welcomes-all-ci-tools/

GitLab CI/CD vs CircleCI

それぞれサービスで GitLab CI/CD との違い、または CircleCI との違いを主張するページがあります。
それぞれの主張を列挙してみます。

GitLab CI/CD の主張

https://about.gitlab.com/comparison/gitlab-vs-circleci.html

  • CLI, API, Webhook を提供しており、これらを活用することで他サービスとの連携が可能である。
  • GitLab CI/CD にあって CircleCI にない機能が 29 個ある。
    • Application performance monitoring and alerts
    • Preview your changes with Review Apps
    • Code Quality
    • Show code coverage rate for your pipelines
    • Auto DevOps
    • Easy integration of existing Kubernetes clusters
    • Easy creation of Kubernetes clusters on GKE
    • etc...

CircleCI の主張

https://circleci.com/gitlab-versus-circleci/

  • チームの成長段階に合った最適なツールとの統合ができる。
    • GitHub, BitBucket, Slack, AWS など、サービス切り替えが容易である。
    • GitLab CI は GitLab のユーザしか使えない。
  • CI/CD にのみ焦点を当てたサービスである。
  • builders の管理が容易。
    • GitLab Runner は独自で管理する必要がある。

まとめると、

GitLab CI/CD「GitLab は、DevOps を実現するための統合ツールであり、我々はその一つのサービスである。DevOps を実現するための機能をたくさん提供している。」

CircleCI「私たちは何かのツールに依存したサービスではない。CI/CD にのみ焦点を当てており、他サービスとの連携・切り替えが容易である。」

みたいなイメージかなと思います。なんとなくそれぞれの CI サービスの色が見えてきた気がします。

YAML ファイル

Python スクリプトをテスト、文法チェック、コードメトリクス計測を実行するシンプルな例で実際の YAML ファイルを比較してみます。

よりスマートに書けるかもしれませんが、GitLab CI/CD も CircleCI もかなり直感的に書けることがわかります。

GitLab CI/CD

.test_template: &test_definition
  stage: test
  image: python:3.7
  before_script:
    - pipenv install --system --dev

pytest:
  <<: *test_definition
  script:
    - py.test --tb=line --cov-report=html
  artifacts:
    paths:
      - htmlcov

flake8:
  <<: *test_definition
  script:
    - flake8

radon:
  <<: *test_definition
  script:
    - radon cc -n C .
    - radon mi -n B .

CircleCI

version: 2
jobs:
  build:
    working_directory: ~/repo
    docker:
      - image: circleci/python:3.7
    steps:
      - checkout
      - run: sudo chown -R circleci:circleci /usr/local/bin
      - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
      - restore_cache:
          key: deps1-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
      - run:
          command: |
            pipenv install --system --dev
      - save_cache:
          key: deps1-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
          paths:
            - ".venv"
            - "/usr/local/bin"
            - "/usr/local/lib/python3.7/site-packages"
      - run:
          command: |
            py.test --tb=line --cov-report=html
      - store_artifacts:
          path: htmlcov/
      - run:
          command: |
            flake8
      - run:
          command: |
            radon cc -n C .
            radon mi -n B .

所感

GitLab CI/CD が優れていると感じた点

  • YAML ファイルに無駄がなく洗練されている。
  • GitLab という一つのサービスでソースコードの管理と CI/CD を実現できる
    • 同じ GUI で利用できる

CircleCI が優れていると感じた点

  • CI の実行速度が速い(体感)
  • GitHub アカウントがあればすぐに始められる

おわりに

どちらも簡単に始めることができますし、条件はありますが基本的に無料で使えます。
さすがどちらのサービスも Forrester に最高ランクである Leader に認定されているだけあります。

個人的には GitLab プロジェクトでは GitLab CI/CD を、GitHub プロジェクトでは CircleCI を選択しています。
ちなみに、 GitLab CI/CD for GitHub という機能があるので GitHub で GitLab CI/CD を使うこともできます。

よりざっくばらんな所感をまとめたブログを書いていますのでよろしければのぞいてみてください。

コテコテの GitLab ユーザが CircleCI に入門してみた

GitHubで編集を提案

Discussion

ログインするとコメントできます