CircleCI
CircleCI2.0

[WIP]CircleCI 2.0 開発効率が一気にあがる知っておきたいこと

ローカルでCircleCIのデバックを行う

前提: Dockerが入っているローカル環境

circleci-cliのインストール
$ curl -o /usr/local/bin/circleci https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci && chmod +x /usr/local/bin/circleci
yamlのシンタックスチェック
$ circleci config validate -c .circleci/config.yml
CircleCiのビルド
$ circleci build

# エラーはこんな感じで見れる
+ tar -xz -C /tmp -f /tmp/docker-17.03.0-ce.tgz
+ sudo mv /tmp/docker/completion /tmp/docker/docker /tmp/docker/docker-containerd /tmp/docker/docker-containerd-ctr /tmp/docker/docker-containerd-shim /tmp/docker/docker-init /tmp/docker/docker-proxy /tmp/docker/docker-runc /tmp/docker/dockerd /usr/bin
====>> Install Docker Compose
  #!/bin/bash -eo pipefail
set -x
sudo curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

++ uname -s
++ uname -m
+ sudo curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-Linux-x86_64
/bin/bash: line 1: /usr/local/bin/docker-compose: Permission denied
Error: Exited with code 1
Step failed
Task failed

DockerのビルドとDocker-compose

stepにsetup_remote_dockerを追加する
https://circleci.com/docs/2.0/building-docker-images/

参考資料