-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.drone.yml
96 lines (88 loc) · 2.91 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
---
kind: pipeline
type: docker
name: default
clone:
depth: 1
platform:
os: linux
arch: arm64
node:
cloud: oracle
location: tokyo
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: cache-docker-buildx-0.14.1
host:
path: /tmp/drone/cache/docker-buildx-0.14.1
- name: gomodcache
host:
path: /var/docker/drone-runner/cache/gomod
steps:
# Multi-platform build, downloading buildx only when not cached
# @see: https://docs.drone.io/pipeline/docker/examples/services/docker/
- name: build-docker
image: docker:dind
when:
event:
- tag
environment:
password:
from_secret: registry-password
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: cache-docker-buildx-0.14.1
path: /root/.docker/cli-plugins
- name: gomodcache
path: /go/pkg/mod
commands:
- |
(
set -x; \
FILE=~/.docker/cli-plugins/docker-buildx; \
[ ! -f $FILE ] && \
wget -O $FILE https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64 \
&& chmod +x $FILE \
|| true
)
- docker login --username=cloverzrg -p $password
- build_node=$(docker buildx create --use)
- echo 'build node:'$build_node
- docker buildx build --platform linux/arm64,linux/amd64,linux/386 -t cloverzrg/frps-docker:$DRONE_TAG -t cloverzrg/frps-docker:latest --push --build-arg DRONE_TAG=$DRONE_TAG .
- docker buildx build -f Dockerfile.frpc --platform linux/arm64,linux/amd64,linux/386 -t cloverzrg/frpc-docker:$DRONE_TAG -t cloverzrg/frpc-docker:latest --push --build-arg DRONE_TAG=$DRONE_TAG .
- docker buildx rm $build_node
- name: build-docker-master
image: docker:dind
when:
event:
- master
environment:
password:
from_secret: registry-password
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: cache-docker-buildx-0.14.1
path: /root/.docker/cli-plugins
- name: gomodcache
path: /go/pkg/mod
commands:
- |
(
set -x; \
FILE=~/.docker/cli-plugins/docker-buildx; \
[ ! -f $FILE ] && \
wget -O $FILE https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64 \
&& chmod +x $FILE \
|| true
)
- DRONE_TAG=master
- docker login --username=cloverzrg -p $password
- build_node=$(docker buildx create --use)
- echo 'build node:'$build_node
- docker buildx build --platform linux/arm64,linux/amd64,linux/386 -t cloverzrg/frps-docker:latest --push --build-arg DRONE_TAG=$DRONE_TAG .
- docker buildx build -f Dockerfile.frpc --platform linux/arm64,linux/amd64,linux/386 -t cloverzrg/frpc-docker:latest --push --build-arg DRONE_TAG=$DRONE_TAG .
- docker buildx rm $build_node