-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy path.drone.yaml
145 lines (143 loc) · 3.81 KB
/
.drone.yaml
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
kind: pipeline
name: build-and-publish
steps:
- name: download modules
image: golang:1.22-alpine
commands:
- sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
- apk update --no-cache && apk add --no-cache tzdata git
- CGO_ENABLED=0 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go mod download
- mkdir -p etc
- cp /etc/ssl/certs/ca-certificates.crt ./etc/ca-certificates.crt
- cp /usr/share/zoneinfo/Asia/Shanghai ./etc/Shanghai
volumes:
- name: gocache
path: /go/pkg/mod
- name: build
path: /tmp/app
when:
event:
- pull_request
- promote
- rollback
- name: build frontend
image: node:20-alpine
commands:
- cd www
- sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
- apk update --no-cache && apk add --no-cache tzdata git openssh
- npm config set registry https://registry.npmmirror.com
# - npm install -g pnpm
- npm install || (sleep 3 && rm -rf node_modules && npm install )
- npm run build || (sleep 3 && rm -rf node_modules && npm install && npm run build)
volumes:
- name: nodecache
path: /drone/src/www/node_modules
when:
event:
- pull_request
- promote
- rollback
- name: build - amd64
image: golang:1.22-alpine
commands:
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel-amd64 cmd/frpp/*.go
volumes:
- name: gocache
path: /go/pkg/mod
- name: build
path: /tmp/app
depends_on:
- build frontend
- download modules
when:
event:
- pull_request
- promote
- rollback
- name: build - arm64
image: golang:1.22-alpine
commands:
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel-arm64 cmd/frpp/*.go
volumes:
- name: gocache
path: /go/pkg/mod
- name: build
path: /tmp/app
depends_on:
- build frontend
- download modules
when:
event:
- pull_request
- promote
- rollback
- name: publish - amd64
image: thegeeklab/drone-docker-buildx:24
privileged: true
settings:
mirror: https://dockerproxy.com
buildkit_config: |
[registry."docker.io"]
mirrors = ["dockerproxy.com"]
debug: true
platforms:
- linux/amd64
build_args:
- ARCH=amd64
repo: vaalacat/frp-panel
tags:
- amd64
registry:
from_secret: DOCKER_REGISTRY
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
depends_on:
- build - amd64
when:
event:
- promote
- rollback
target:
- production
- name: publish - arm64
image: thegeeklab/drone-docker-buildx:24
privileged: true
settings:
mirror: https://dockerproxy.com
buildkit_config: |
[registry."docker.io"]
mirrors = ["dockerproxy.com"]
debug: false
platforms:
- linux/arm64
build_args:
- ARCH=arm64
repo: vaalacat/frp-panel
tags:
- arm64
registry:
from_secret: DOCKER_REGISTRY
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
depends_on:
- build - arm64
when:
event:
- promote
- rollback
target:
- production
volumes:
- name: build
temp: {}
- name: gocache
host:
path: /tmp/drone/frp-panel/gocache
- name: nodecache
host:
path: /tmp/drone/frp-panel/nodecache