-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
120 lines (103 loc) · 2.66 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
kind: pipeline
type: docker
name: default
volumes:
- name: dist
host:
path: /home/norah1to/cache/zscnsd/dist
- name: node_modules
host:
path: /home/norah1to/cache/zscnsd/node_modules
steps:
- name: mkdir
when:
event: push
branch: master
image: appleboy/drone-ssh:1.6.3
settings:
host: drone.norah1to.com
username:
from_secret: account_1
password:
from_secret: password_1
port: 22
script:
- mkdir -p /home/norah1to/cache/zscnsd/dist
- mkdir -p /home/norah1to/cache/zscnsd/node_modules
- rm -rf /home/norah1to/cache/zscnsd/dist/*
- name: build
when:
event: push
branch: master
image: node:12.16
volumes:
- name: dist
path: /tmp/cache/dist
- name: node_modules
path: /drone/src/node_modules
commands:
- npm config set registry http://registry.npm.taobao.org
- npm install
- npm run build
- cp -r ./dist/* /tmp/cache/dist
- name: copy
when:
event: push
branch: master
image: appleboy/drone-ssh:1.6.3
settings:
host: drone.norah1to.com
username:
from_secret: account_1
password:
from_secret: password_1
port: 22
script:
- mkdir /home/norah1to/nginx/www/zscnsd
- rm -rf /home/norah1to/nginx/www/zscnsd/*
- cp -r /home/norah1to/cache/zscnsd/dist/* /home/norah1to/nginx/www/zscnsd
- rm -rf /home/norah1to/cache/zscnsd/dist/*
- name: serverchan-success
when:
branch: master
status:
- success
image: yakumioto/drone-serverchan:2
settings:
key:
from_secret: server_chan_key
text: '${DRONE_REPO_NAME} CI SUCCESS'
desp: 'Branch: `${DRONE_COMMIT_BRANCH}`
[${DRONE_COMMIT_LINK}](${DRONE_COMMIT_LINK})
Author: `${DRONE_COMMIT_AUTHOR}`'
- name: serverchan-fail
when:
branch: master
status:
- failure
image: yakumioto/drone-serverchan:2
settings:
key:
from_secret: server_chan_key
text: '${DRONE_REPO_NAME} CI FAIL'
desp: 'Branch: `${DRONE_COMMIT_BRANCH}`
> Fail steps: `${DRONE_FAILED_STEPS}`
[${DRONE_COMMIT_LINK}](${DRONE_COMMIT_LINK})
Author: `${DRONE_COMMIT_AUTHOR}`'
# - name: copy
# when:
# event: push
# branch: master
# image: plugins/docker
# volumes:
# - name: dist
# path: /dist
# settings:
# dockerfile: Dockerfile
# username:
# from_secret: account
# password:
# from_secret: password
# repo: zscnsd
# tags:
# - latest