-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy path.drone.yml
91 lines (91 loc) · 2.15 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
kind: pipeline
name: zbxtable
steps:
- name: build
image: canhgia809/go:1.21.4-upx
commands:
- wget -q -c https://dl.cactifans.com/stable/zbxtable/web-latest.tar.gz && tar xf web-latest.tar.gz
- go install github.com/go-bindata/go-bindata/go-bindata@latest
- chmod a+x ./control
- ./control build
- mv zbxtable zbxtable-${DRONE_COMMIT_SHA:0:10}-${DRONE_BUILD_NUMBER}
- upx -9 -o zbxtable zbxtable-${DRONE_COMMIT_SHA:0:10}-${DRONE_BUILD_NUMBER}
- ./control pack
- name: scp dev
image: appleboy/drone-scp
settings:
host:
from_secret: 222_host
port:
from_secret: port
username:
from_secret: username
password:
from_secret: 222_password
command_timeout: 10m
target:
- /home/wwwroot/downloads/dev
source:
- ./*.tar.gz
when:
branch:
- dev
- name: scp prod
image: appleboy/drone-scp
settings:
host:
from_secret: 222_host
port:
from_secret: port
username:
from_secret: username
password:
from_secret: 222_password
command_timeout: 10m
target:
- /home/wwwroot/downloads/stable
source:
- ./*.tar.gz
when:
branch:
- 2.1
- name: scp demo
image: appleboy/drone-scp
settings:
host:
from_secret: demo_host
port:
from_secret: demo_port
username:
from_secret: demo_username
password:
from_secret: demo_password
command_timeout: 10m
target:
- /tmp/zbxtable
source:
- zbxtable
rm: true
when:
branch:
- demo
- name: ssh restart
image: appleboy/drone-ssh
settings:
host:
from_secret: demo_host
username:
from_secret: demo_username
password:
from_secret: demo_password
port:
from_secret: demo_port
command_timeout: 10m
script:
- systemctl stop zbxtable
- rm -rf /usr/local/zbxtable/zbxtable
- mv /tmp/zbxtable/zbxtable /usr/local/zbxtable/
- systemctl start zbxtable
when:
branch:
- demo