LoginSignup
8
6

More than 5 years have passed since last update.

docker-composeで爆速でローカルにconcourseを立てる

Last updated at Posted at 2018-12-04

環境

macOS High Sierra 10.13.6

$ docker -v
Docker version 18.09.0, build 4d60db4
$ docker-compose version
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0h  27 Mar 2018

Hello Concourse!

$ wget https://concourse-ci.org/docker-compose.yml
$ docker-compose up -d
Creating docs_concourse-db_1 ... done
Creating docs_concourse_1    ... done

http://127.0.0.1:8080/ にアクセスしてconcourseのcliであるflyコマンドをダウンロードしましょう。
スクリーンショット 2018-12-04 23.23.06.png

ダウンロードが完了したらコマンドに実行権限をつけてあげます。今回はPATHの通っているところに移動もします。

$ chmod +x ~/Downloads/fly
$ mv ~/Downloads/fly /usr/local/bin
$ fly -v
4.2.1

Login

cli

$ fly -t main login -c http://127.0.0.1:8080 -n main -u test -p test

UI

スクリーンショット 2018-12-04 23.28.17.png

username: test
password: test
でログインできます。

Set-Pipeline

せっかくなので1つpipelineをsetしてみましょう。
以下のファイルを用意してください。

pipeline.yml
resources:
- name: booklit
  type: git
  source: {uri: "https://github.com/vito/booklit"}

jobs:
- name: unit
  plan:
  - get: booklit
    trigger: true
  - task: test
    file: booklit/ci/test.yml

githubから https://github.com/vito/booklit のリポジトリを取得して、取得したTaskの設定ファイルを利用してテストをするようなパイプラインですね。

$ fly -t main set-pipeline -p booklit -c ./pipeline.yml
resources:
  resource booklit has been added:
+ name: booklit
+ type: git
+ source:
+   uri: https://github.com/vito/booklit

jobs:
  job unit has been added:
+ name: unit
+ plan:
+ - get: booklit
+   trigger: true
+ - task: test
+   file: booklit/ci/test.yml

apply configuration? [yN]: y
pipeline created!
you can view your pipeline here: http://127.0.0.1:8080/teams/main/pipelines/booklit

the pipeline is currently paused. to unpause, either:
  - run the unpause-pipeline command
  - click play next to the pipeline in the web ui

setしただけではパイプラインがpause状態であるため、flyコマンドでunpauseします。(UIから行うこともできます)

$ fly -t main unpause-pipeline -p booklit
unpaused 'booklit'

http://127.0.0.1:8080/teams/main/pipelines/booklit にアクセスしてみます。
PipelineがunpauseされJobがstartされたのが確認できます。
あとは動画でお楽しみください。

qiita-quick.mov.gif

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6