-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
89 lines (89 loc) · 1.9 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
kind: pipeline
type: kubernetes
name: default
steps:
- name: build-linux-amd64
image: golang:1.22.5-alpine
environment:
GOOS: linux
GOARCH: amd64
commands:
- go mod tidy
- go build -v -o app -ldflags "-s -w" --trimpath
when:
event:
- tag
- name: build-image-amd64
image: plugins/docker
pull: if-not-exists
settings:
platform: linux/amd64
repo: xbclub/mi-router-monitor
tag:
- latest-amd64
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
purge: false
depends_on:
- build-linux-amd64
when:
event:
- tag
- name: build-linux-arm64
image: golang:1.22.5-alpine
environment:
GOOS: linux
GOARCH: arm64
commands:
- rm -f app
- go mod tidy
- go build -v -o app -ldflags "-s -w" --trimpath
depends_on:
- build-image-amd64
when:
event:
- tag
- name: build-image-arm64
image: plugins/docker
pull: if-not-exists
settings:
platform: linux/arm64
repo: xbclub/mi-router-monitor
environment:
- DOCKER_BUILDKIT: 1
tag:
- latest-arm64
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
purge: false
depends_on:
- build-linux-arm64
when:
event:
- tag
- name: mergeimages
image: plugins/manifest
settings:
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
target: xbclub/mi-router-monitor:latest
template: xbclub/mi-router-monitor:latest-ARCH
platforms:
- linux/amd64
- linux/arm64
tags:
- ${DRONE_TAG}
depends_on:
- build-image-amd64
- build-image-arm64
when:
event:
- tag
node_selector:
kubernetes.io/arch: "amd64"