This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.drone.yml
167 lines (154 loc) · 4.92 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
kind: pipeline
type: docker
name: cross
platform:
os: linux
arch: amd64
steps:
- name: prepare
image: library/alpine:3.14
environment:
GOLANG: golang:1.16-alpine3.14
IMAGE: drone.cattle.io/rancher/kim
commands:
- "apk --no-cache add docker-cli git"
- "docker build --target docker --build-arg GOLANG --tag $${IMAGE}:possible --tag $${IMAGE}:$(git rev-parse --short HEAD) ."
volumes:
- name: docker
path: /var/run/docker.sock
- name: bin-dist
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- make GOOS=linux GOARCH=amd64 TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=linux GOARCH=arm64 TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=linux GOARCH=arm TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=linux GOARCH=s390x TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=linux GOARCH=ppc64le TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=darwin GOARCH=amd64 TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=darwin GOARCH=arm64 TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
- make GOOS=windows GOARCH=amd64 TAG=${DRONE_TAG:-$(git describe --tags --always)} dist
volumes:
- name: docker
path: /var/run/docker.sock
- name: img-dist
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=amd64 image-dist
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=arm64 image-dist
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=arm image-dist
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=ppc64le image-dist
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=s390x image-dist
volumes:
- name: docker
path: /var/run/docker.sock
- name: bin-upload
image: plugins/github-release
settings:
api_key:
from_secret: github_token
checksum:
- sha256
checksum_file: CHECKSUMsum.txt
checksum_flatten: true
files:
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
- name: img-push
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=amd64 image-push
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=arm64 image-push
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=arm image-push
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=ppc64le image-push
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} GOARCH=s390x image-push
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- tag
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
volumes:
- name: docker
host:
path: /var/run/docker.sock
---
kind: pipeline
type: docker
name: manifest
platform:
os: linux
arch: amd64
steps:
- name: prepare
image: library/alpine:3.14
environment:
GOLANG: golang:1.16-alpine3.14
IMAGE: drone.cattle.io/rancher/kim
commands:
- "apk --no-cache add docker-cli git"
- "docker build --target docker --build-arg GOLANG --tag $${IMAGE}:possible --tag $${IMAGE}:$(git rev-parse --short HEAD) ."
volumes:
- name: docker
path: /var/run/docker.sock
- name: manifest-all
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image-manifest-all
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- tag
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
volumes:
- name: docker
host:
path: /var/run/docker.sock
depends_on:
- cross
...