-
Notifications
You must be signed in to change notification settings - Fork 100
/
.drone.yml
121 lines (109 loc) · 3.14 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
workspace:
base: /data/apps/opt
path: webim-h5
pipeline:
restore-cache:
image: drillster/drone-volume-cache
restore: true
mount:
- node_modules
- tag
volumes:
- /data/apps/opt/webim-h5:/cache
build:
image: node:7.8
privileged: true
commands:
- cd sdk && npm link && cd ..
- cd webrtc && npm link && cd ..
- cd emedia && npm link && cd ..
- npm link easemob-websdk
- npm link easemob-webrtc
- npm link easemob-emedia
- cd demo && npm install
- npm run build
# 2.0 demo 相关编译操作在demo目录下面
- cd ..
- cp -rf demo/build image/docker/webim/webim
- cp -rf demo/storybook-static image/docker/webim/storybook
- echo 'build success'
when:
branch: [ dev, master ]
dockerize-sandbox:
image: plugins/docker
environment:
- DOCKER_LAUNCH_DEBUG=true
debug: true
repo: docker-registry-cn.easemob.com/kubernetes/im/webim
#2.0会被drone截断成2
tags: 20
registry: docker-registry-cn.easemob.com
secrets: [ docker_username, docker_password ]
dockerfile: image/docker/webim/Dockerfile
context: image/docker/webim/
when:
branch: dev
deploy-sandbox:
image: docker-registry-cn.easemob.com/kubernetes/im/webim-h5-deploy:latest
pull: true
environment:
- DOCKER_LAUNCH_DEBUG=true
- TAG=20
secrets: [ ssh_key, jumpserver_host, jumpserver_port, sandbox_host ]
debug: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
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: master
deploy-online:
image: docker-registry-cn.easemob.com/kubernetes/im/webim-h5-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
volumes:
- /data/tag/webim-h5:/data/tag/webim-h5
- /var/run/docker.sock:/var/run/docker.sock
when:
branch: master
rollback-online:
image: docker-registry-cn.easemob.com/kubernetes/im/webim-h5-rollback:latest
pull: true
environment:
- DOCKER_LAUNCH_DEBUG=true
secrets: [ ssh_key, jumpserver_host, jumpserver_port, online_host ]
debug: true
volumes:
- /data/tag/webim-h5:/data/tag/webim-h5
- /var/run/docker.sock:/var/run/docker.sock
when:
branch: rollback
rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
mount:
- node_modules
- tag
volumes:
- /data/apps/opt/webim-h5:/cache
notify:
image: drillster/drone-email
port: 25
secrets: [ plugin_host, plugin_from, plugin_username, plugin_password ]
when:
status: [ failure, success ]