Merge pull request #111 from appleboy/patch-1

update drone ci cd
pull/112/head
Jimmy Song 2018-01-14 15:00:41 +08:00 committed by GitHub
commit 202e09936d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 10 deletions

View File

@ -8,7 +8,7 @@
**1. 在Github上创建一个新的OAtuh应用** **1. 在Github上创建一个新的OAtuh应用**
访问https://github.com/settings/applications/new创建新的OAuth应用。 访问[此頁面](https://github.com/settings/applications/new)创建新的OAuth应用。
![OAuth注册](../images/github-oauth-register.jpg) ![OAuth注册](../images/github-oauth-register.jpg)
@ -31,22 +31,25 @@ version: '2'
services: services:
drone-server: drone-server:
image: drone/drone:0.7 image: drone/drone:0.8
ports: ports:
- 80:8000 - 80:8000
- 9000
volumes: volumes:
- /var/lib/drone:/var/lib/drone/ - /var/lib/drone:/var/lib/drone/
restart: always restart: always
environment: environment:
- DRONE_OPEN=true - DRONE_OPEN=true
- DRONE_ADMIN=jimmy - DRONE_HOST=${DRONE_HOST}
- DRONE_HOST=localhost
- DRONE_GITHUB=true - DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT} - DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET} - DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=admin - DRONE_SECRET=${DRONE_SECRET}
drone-agent: drone-agent:
image: drone/drone:0.7 image: drone/agent:0.8
command: agent command: agent
restart: always restart: always
depends_on: depends_on:
@ -54,8 +57,8 @@ services:
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
environment: environment:
- DRONE_SERVER=ws://drone-server:8000/ws/broker - DRONE_SERVER=drone-server:9000
- DRONE_SECRET=admin - DRONE_SECRET=${DRONE_SECRET}
``` ```
- `/var/lib/drone`是在本地挂载的目录请确保该目录已存在且可以被docker访问到Mac下可以在docker的共享目录中配置。 - `/var/lib/drone`是在本地挂载的目录请确保该目录已存在且可以被docker访问到Mac下可以在docker的共享目录中配置。
@ -72,7 +75,7 @@ docker-compose up
这样是在前台启动,加上`-d`参数就可以在后台启动。 这样是在前台启动,加上`-d`参数就可以在后台启动。
访问http://localhost可以看到登陆画面。 访问 `http://localhost` 可以看到登陆画面。
![Drone登陆界面](../images/drone-login-github.jpg) ![Drone登陆界面](../images/drone-login-github.jpg)
@ -86,4 +89,4 @@ docker-compose up
- [Drone Installation](http://docs.drone.io/installation/) - [Drone Installation](http://docs.drone.io/installation/)
- [Github - Drone](https://github.com/drone/drone) - [Github - Drone](https://github.com/drone/drone)
- [Drone 搭配 Kubernetes 升級應用程式版本 - blog.wu-boy.com](https://blog.wu-boy.com/2017/10/upgrade-kubernetes-container-using-drone/) - [Drone 搭配 Kubernetes 升級應用程式版本 - blog.wu-boy.com](https://blog.wu-boy.com/2017/10/upgrade-kubernetes-container-using-drone/)