drone 1.0 docker-compose 运行试用
drone 1.0 已经rc了,新的界面以及新的功能
github 客户端创建
docker-compose 文件
version: '3'
services:
drone-server:
image: drone/drone:1.0.0-rc.1
ports:
- "80:80"
volumes:
- ./drone:/var/lib/drone/
environment:
- DRONE_OPEN=true
-DRONE_SERVER_HOST=drone-server
- DRONE_GITHUB_SERVER=https://github.com
- DRONE_GITHUB_CLIENT_ID=clientid
- DRONE_GITHUB_CLIENT_SECRET=secret
- DRONE_DEBUG=true
- DRONE_GITHUB=true
- DRONE_PROVIDER=github
- DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
drone-agent:
image: drone/agent:1.0.0-rc.1
depends_on:
- drone-server
environment:
- DRONE_RPC_SERVER=http://drone-server
- DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
- DRONE_DEBUG=true
- DOCKER_HOST=tcp://docker-bind:2375
docker-bind:
image: docker:dind
privileged: true
command: --storage-driver=overlay
运行&&测试
- 运行
docker-compose up -d
- 效果
gogs 集成
- docker-compose 文件
version: '3'
services:
drone-server:
image: drone/drone:1.0.0-rc.1
ports:
- "80:80"
volumes:
- ./drone:/var/lib/drone/
environment:
- DRONE_OPEN=true
-DRONE_SERVER_HOST=drone-server
- DRONE_GITHUB_SERVER=https://github.com
- DRONE_DEBUG=true
- DRONE_GIT_ALWAYS_AUTH=false
- DRONE_GOGS=true
- DRONE_GOGS_SKIP_VERIFY=false
- DRONE_GOGS_SERVER=http://localhost:3000
- DRONE_PROVIDER=gogs
- DRONE_SERVER_PROTO=http
- DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
gogs:
image: gogs/gogs
ports:
- "10022:22"
- "3000:3000"
volumes:
- ./data/gogs:/data
depends_on:
- mysql
mysql:
image: mysql:5.7.16
volumes:
- ./gogs/mysql:/var/lib/mysql
ports:
- 3308:3306
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: dalongrong
MYSQL_DATABASE: gogs
MYSQL_USER: gogs
MYSQL_PASSWORD: dalongrong
TZ: Asia/Shanghai
drone-agent:
image: drone/agent:1.0.0-rc.1
depends_on:
- drone-server
environment:
- DRONE_RPC_SERVER=http://drone-server
- DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
- DRONE_DEBUG=true
- DOCKER_HOST=tcp://docker-bind:2375
docker-bind:
image: docker:dind
privileged: true
command: --storage-driver=overlay
- 界面
gitlab 集成
- docker-compose 文件
version: '3'
services:
drone-server:
image: drone/drone:1.0.0-rc.1
ports:
- "80:80"
volumes:
- ./drone:/var/lib/drone/
environment:
- DRONE_OPEN=true
-DRONE_SERVER_HOST=drone-server
- DRONE_DEBUG=true
- DRONE_GIT_ALWAYS_AUTH=false
- DRONE_GITLAB_SERVER=https://gitlab.com
- DRONE_GITLAB_CLIENT_ID=clientid
- DRONE_GITLAB_CLIENT_SECRET=secret
- DRONE_PROVIDER=gitlab
- DRONE_SERVER_PROTO=http
- DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
mysql:
image: mysql:5.7.16
volumes:
- ./gogs/mysql:/var/lib/mysql
ports:
- 3308:3306
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: dalongrong
MYSQL_DATABASE: gogs
MYSQL_USER: gogs
MYSQL_PASSWORD: dalongrong
TZ: Asia/Shanghai
drone-agent:
image: drone/agent:1.0.0-rc.1
depends_on:
- drone-server
environment:
- DRONE_RPC_SERVER=http://drone-server
- DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
- DRONE_DEBUG=true
- DOCKER_HOST=tcp://docker-bind:2375
docker-bind:
image: docker:dind
privileged: true
command: --storage-driver=overlay
- 效果
参考资料
https://docs.drone.io/intro/github/single-machine/
https://docs.drone.io/intro/gogs/
https://docs.drone.io/install/agents/linux-amd64/
https://docs.drone.io/intro/gitlab/single-machine/