forked from easemob/web-im
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
123 lines (111 loc) · 3.17 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
workspace:
base: /data/apps/opt
path: web-im
pipeline:
restore-cache:
image: drillster/drone-volume-cache
restore: true
mount:
- node_modules
- tag
volumes:
- /data/apps/opt/web-im/${DRONE_BRANCH}:/cache
build:
image: node:7.8
privileged: true
commands:
- npm run build
- mkdir -p publish/demo/javascript
- cp -r demo/images publish/demo
- cp -r demo/stylesheet publish/demo
- cp -r demo/javascript/dist publish/demo/javascript/
- rm publish/demo/javascript/dist/debug.js
- cp -r demo/javascript/src publish/demo/javascript/
- mkdir publish/sdk
- cp -r sdk/dist publish/sdk
- cp -r sdk/src publish/sdk
- cp sdk/*.* publish/sdk
- cp -r webrtc publish
- cp favicon.ico publish/
- cp index.html publish/
- cp CHANGELOG.md publish/
- cp package.json publish/
- cp webpack.config.js publish/
- cp README.md publish/
- cp .babelrc publish/
- cp -rf publish image/docker/webim/webim
- echo 'build success'
when:
branch: [ dev, online ]
dockerize-latest:
image: plugins/docker
environment:
- DOCKER_LAUNCH_DEBUG=true
debug: true
repo: docker-registry-cn.easemob.com/kubernetes/im/webim
tags: latest
registry: docker-registry-cn.easemob.com
secrets: [ docker_username, docker_password ]
dockerfile: image/docker/webim/Dockerfile
context: image/docker/webim/
when:
branch: dev
deploy-latest:
image: docker-registry-cn.easemob.com/kubernetes/im/webim-deploy:latest
pull: true
environment:
- DOCKER_LAUNCH_DEBUG=true
- TAG=latest
secrets: [ ssh_key, jumpserver_host, jumpserver_port, sandbox_host ]
debug: true
when:
branch: dev
dockerize-online:
image: plugins/docker
environment:
- DOCKER_LAUNCH_DEBUG=true
debug: true
repo: docker-registry-cn.easemob.com/kubernetes/im/webim
tags: ${DRONE_COMMIT:0:7}
registry: docker-registry-cn.easemob.com
secrets: [ docker_username, docker_password ]
dockerfile: image/docker/webim/Dockerfile
context: image/docker/webim/
when:
branch: online
deploy-online:
image: docker-registry-cn.easemob.com/kubernetes/im/webim-online:latest
pull: true
environment:
- DOCKER_LAUNCH_DEBUG=true
- TAG=${DRONE_COMMIT:0:7}
secrets: [ ssh_key, jumpserver_host, jumpserver_port, online_host ]
debug: true
when:
branch: online
rollback-online:
image: docker-registry-cn.easemob.com/kubernetes/im/webim-rollback:latest
pull: true
environment:
- DOCKER_LAUNCH_DEBUG=true
secrets: [ ssh_key, jumpserver_host, jumpserver_port, online_host ]
debug: true
when:
branch: rollback
rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
mount:
- node_modules
- tag
volumes:
- /data/apps/opt/web-im/${DRONE_BRANCH}:/cache
notify:
image: drillster/drone-email
from: [email protected]
host: smtp.exmail.qq.com
port: 25
username: [email protected]
password: 'Easemob536^@#'
when:
status: [ failure, success ]