LoginSignup
1
1

More than 5 years have passed since last update.

DigitalOceanにDrone 0.8 をインストールする

Last updated at Posted at 2017-09-28

以前0.4で同じことをしましたが、それのアップデートです。Droneのバージョンを最新の0.8.0にします。docker-composeを使って起動できるようになったようです。今回もドキュメントに沿って進めました。ついでにこちらを参考に、SSL化もしました。

  • DigitalOceanの One Click AppsでDocker 17.05.0-ce on 16.04を選択し、Dropletを作成
  • 作成したサーバにsshでログインし以下の操作を行う

docker-compose.yml の作成

vi /USERNAME/docker-compose.yml
  • GitHubの Settings > Developer settings > OAuth Apps から、Drone用のAppを作成
  • callback urlhttps://DRONE_HOST/authorizeにして、発行されたclinet_idとsecretを、それぞれ下記のDRONE_GITHUB_CLIENTDRONE_GITHUB_SECRETに設定
  • DRONE_SECRETは、ドキュメントによると任意で設定すれば良いようなので、random password generatorで作成して記入
  • DRONE_HOSTも環境に合わせて設定

Create a secret passcode that will be used to authenticate your builds agents. We recommend using a random password generator to create this secret passcode.

version: '2'

services:
  drone-server:
    image: drone/drone:0.8.0
    ports:
      - 443:443
      - 80:8000
    volumes:
      - ./drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_HOST=https://DRONE_HOST
      - DRONE_OPEN=true
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=DRONE_GITHUB_CLIENT
      - DRONE_GITHUB_SECRET=DRONE_GITHUB_SECRET
      - DRONE_SECRET=DRONE_SECRET
      - DRONE_LETS_ENCRYPT=true

  drone-agent:
    image: drone/drone:0.8.0
    command: agent
    restart: always
    depends_on: [ drone-server ]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=ws://drone-server:8000/ws/broker
      - DRONE_SECRET=DRONE_SECRET

起動

docker-compose up -d

以上です。

1
1
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
1
1