2016-01-11 17:21:41 +02:00
|
|
|
drone
|
|
|
|
=====
|
|
|
|
|
|
|
|
[Drone][1] is a Continuous Integration platform built on Docker, written in Go.
|
|
|
|
|
|
|
|
## github
|
|
|
|
|
2019-10-01 07:36:54 +02:00
|
|
|
```yaml
|
|
|
|
drone:
|
|
|
|
image: drone/drone:1.5-linux-amd64
|
|
|
|
ports:
|
|
|
|
- "8080:80"
|
|
|
|
volumes:
|
|
|
|
- ./data:/data
|
|
|
|
environment:
|
|
|
|
- DRONE_AGENTS_ENABLED=true
|
|
|
|
- DRONE_SERVER_PROTO=http
|
|
|
|
- DRONE_SERVER_HOST=drone.easypi.pro
|
|
|
|
- DRONE_RPC_SECRET=secret
|
|
|
|
- DRONE_GITHUB_SERVER=https://github.com
|
|
|
|
- DRONE_GITHUB_CLIENT_ID=xxxxxx
|
|
|
|
- DRONE_GITHUB_CLIENT_SECRET=xxxxxx
|
|
|
|
restart: always
|
|
|
|
```
|
|
|
|
|
2016-01-11 17:21:41 +02:00
|
|
|
```yaml
|
|
|
|
#
|
|
|
|
# Github » Settings » Applications » Developer applications » Register new application
|
|
|
|
#
|
|
|
|
Application name: drone
|
2019-10-01 07:36:54 +02:00
|
|
|
Homepage URL: http://drone.easypi.pro/
|
2016-01-11 17:21:41 +02:00
|
|
|
Application description: Drone is a Continuous Integration platform built on Docker, written in Go
|
2019-10-01 07:36:54 +02:00
|
|
|
Authorization callback URL: http://drone.easypi.pro/authorize
|
2016-01-11 17:21:41 +02:00
|
|
|
Client ID: ... (generated by github)
|
|
|
|
Client Secret: ... (generated by github)
|
|
|
|
```
|
|
|
|
|
2016-05-31 17:16:56 +02:00
|
|
|
> Drone will register gogs webhooks automatically, you don't need to do it manually.
|
|
|
|
|
2016-01-11 17:21:41 +02:00
|
|
|
## nginx/sites-enabled/drone
|
|
|
|
|
|
|
|
```
|
|
|
|
server {
|
|
|
|
listen 80;
|
2019-10-01 07:36:54 +02:00
|
|
|
server_name drone.easypi.pro;
|
2016-01-11 17:21:41 +02:00
|
|
|
location / {
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header Origin "";
|
|
|
|
|
2019-10-01 07:36:54 +02:00
|
|
|
proxy_pass http://127.0.0.1:8080;
|
2016-01-11 17:21:41 +02:00
|
|
|
proxy_redirect off;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_buffering off;
|
|
|
|
|
|
|
|
chunked_transfer_encoding off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## up and running
|
|
|
|
|
2016-05-31 17:16:56 +02:00
|
|
|
```bash
|
2016-01-11 17:21:41 +02:00
|
|
|
# server
|
|
|
|
$ cd ~/fig/drone/
|
|
|
|
$ docker-compose up -d
|
2019-10-01 07:36:54 +02:00
|
|
|
$ docker-compose logs -f
|
2016-01-11 17:21:41 +02:00
|
|
|
|
2016-05-31 17:16:56 +02:00
|
|
|
# client (login with remote driver credential)
|
2019-10-01 07:36:54 +02:00
|
|
|
$ firefox http://drone.easypi.pro/
|
2016-01-11 17:21:41 +02:00
|
|
|
```
|
|
|
|
|
2019-10-01 07:36:54 +02:00
|
|
|
[1]: https://readme.drone.io
|