-
Notifications
You must be signed in to change notification settings - Fork 32
/
.drone.yml
105 lines (89 loc) · 2 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
kind: pipeline
name: TeamStandard
type: docker
platform:
os: linux
arch: amd64
steps:
# 恢复缓存
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
# 安装依赖
- name: install-package
image: node:10
commands:
- node --version
- npm --version
- npm config set registry https://registry.npm.taobao.org
- npm install gitbook-cli -ddd
- npm install gitbook-plugin-todo gitbook-plugin-mermaid-v8 -ddd
- ./node_modules/.bin/gitbook install
- ./node_modules/.bin/gitbook build
# 重建缓存
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
when:
event: push
# 构建镜像
- name: build-image
image: plugins/docker
settings:
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
repo: alicfeng/team_standard
tags: ${DRONE_TAG=latest}
force_tag: true
pull_image: false
mirror: http://hub-mirror.c.163.com
# 部署文档
- name: deploy-doc
image: appleboy/drone-ssh
settings:
host:
from_secret: DOCUMENT_SERVER_HOST
username:
from_secret: DOCUMENT_SERVER_USERNAME
password:
from_secret: DOCUMENT_SERVER_PASSWORD
port: 22
script:
- docker pull alicfeng/team_standard:latest
- cd /home/alicfeng/tutorial/ev/dev_tool/document
- docker-compose up -d team_standard
# 邮件通知
- name: notify-email
image: drillster/drone-email
settings:
from: 18814129510@163.com
host: smtp.163.com
username: 18814129510@163.com
password:
from_secret: NOTIFY_EMAIL_PASSWORD
port: 465
skip_verify: true
subject: CICD Profession Notify
recipients:
- a@samego.com
when:
status: [ failure, success ]
# 挂载声明
volumes:
- name: cache
host:
path: /tmp/cache/node_modules