Skip to content

Commit 7979849

Browse files
Merge pull request #10 from drone-plugins/push_gar
Push image to gar
2 parents e62d4c0 + 93870b3 commit 7979849

File tree

6 files changed

+297
-0
lines changed

6 files changed

+297
-0
lines changed

.drone.yml

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,244 @@ trigger:
3030
- refs/heads/main
3131
- "refs/tags/**"
3232
- "refs/pull/**"
33+
34+
---
35+
kind: pipeline
36+
type: vm
37+
name: windows-1809
38+
39+
pool:
40+
use: windows
41+
42+
platform:
43+
os: windows
44+
arch: amd64
45+
46+
steps:
47+
- name: go build
48+
image: golang:1.19
49+
environment:
50+
CGO_ENABLED: 0
51+
commands:
52+
- go build -o release/windows/amd64/buildx-gar.exe ./cmd/drone-buildx-gar
53+
- name: build gar plugin
54+
image: plugins/docker:20.17.4-windows-1809-amd64
55+
settings:
56+
dockerfile: docker/gar/Dockerfile.windows.amd64.1809
57+
repo: plugins/buildx-gar
58+
username:
59+
from_secret: docker_username
60+
password:
61+
from_secret: docker_password
62+
auto_tag: true
63+
auto_tag_suffix: windows-1809-amd64
64+
purge: false
65+
when:
66+
event: [push, tag]
67+
68+
depends_on:
69+
- testing
70+
71+
trigger:
72+
ref:
73+
- refs/heads/master
74+
- refs/tags/*
75+
- "refs/pull/**"
76+
77+
---
78+
kind: pipeline
79+
type: vm
80+
name: windows-ltsc2022
81+
82+
pool:
83+
use: windows-2022
84+
85+
platform:
86+
os: windows
87+
88+
steps:
89+
- name: go build
90+
image: golang:1.19
91+
environment:
92+
CGO_ENABLED: 0
93+
commands:
94+
- go build -o release/windows/amd64/buildx-gar.exe ./cmd/drone-buildx-gar
95+
- name: build gar plugin
96+
image: plugins/docker
97+
settings:
98+
dockerfile: docker/gar/Dockerfile.windows.amd64.ltsc2022
99+
repo: plugins/buildx-gar
100+
username:
101+
from_secret: docker_username
102+
password:
103+
from_secret: docker_password
104+
auto_tag: true
105+
auto_tag_suffix: windows-ltsc2022-amd64
106+
purge: false
107+
when:
108+
event: [push, tag]
109+
110+
depends_on:
111+
- testing
112+
113+
trigger:
114+
ref:
115+
- refs/heads/master
116+
- refs/tags/*
117+
- "refs/pull/**"
118+
119+
---
120+
kind: pipeline
121+
name: linux-amd64-gar
122+
type: vm
123+
124+
pool:
125+
use: ubuntu
126+
127+
platform:
128+
os: linux
129+
arch: amd64
130+
131+
steps:
132+
- name: build-push
133+
image: golang:1.19
134+
commands:
135+
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/buildx-gar ./cmd/drone-buildx-gar'
136+
environment:
137+
CGO_ENABLED: 0
138+
when:
139+
event:
140+
exclude:
141+
- tag
142+
- name: build-tag
143+
image: golang:1.19
144+
commands:
145+
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/buildx-gar ./cmd/drone-buildx-gar'
146+
environment:
147+
CGO_ENABLED: 0
148+
when:
149+
event:
150+
- tag
151+
- name: publish
152+
image: plugins/docker:18
153+
settings:
154+
auto_tag: true
155+
auto_tag_suffix: linux-amd64
156+
daemon_off: false
157+
dockerfile: docker/gar/Dockerfile.linux.amd64
158+
password:
159+
from_secret: docker_password
160+
repo: plugins/buildx-gar
161+
username:
162+
from_secret: docker_username
163+
when:
164+
event:
165+
exclude:
166+
- pull_request
167+
168+
trigger:
169+
ref:
170+
- refs/heads/master
171+
- "refs/tags/**"
172+
- "refs/pull/**"
173+
174+
depends_on:
175+
- testing
176+
177+
---
178+
kind: pipeline
179+
name: linux-arm64-gar
180+
type: vm
181+
182+
pool:
183+
use: ubuntu_arm64
184+
185+
platform:
186+
os: linux
187+
arch: arm64
188+
189+
steps:
190+
- name: build-push
191+
image: golang:1.19
192+
commands:
193+
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/buildx-gar ./cmd/drone-buildx-gar'
194+
environment:
195+
CGO_ENABLED: 0
196+
when:
197+
event:
198+
exclude:
199+
- tag
200+
201+
- name: build-tag
202+
image: golang:1.19
203+
commands:
204+
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/buildx-gar ./cmd/drone-buildx-gar'
205+
environment:
206+
CGO_ENABLED: 0
207+
when:
208+
event:
209+
- tag
210+
211+
- name: publish
212+
image: plugins/docker:18
213+
settings:
214+
auto_tag: true
215+
auto_tag_suffix: linux-arm64
216+
daemon_off: false
217+
dockerfile: docker/gar/Dockerfile.linux.arm64
218+
password:
219+
from_secret: docker_password
220+
repo: plugins/buildx-gar
221+
username:
222+
from_secret: docker_username
223+
when:
224+
event:
225+
exclude:
226+
- pull_request
227+
228+
trigger:
229+
ref:
230+
- refs/heads/master
231+
- "refs/tags/**"
232+
- "refs/pull/**"
233+
234+
depends_on:
235+
- testing
236+
237+
---
238+
kind: pipeline
239+
name: notifications-gar
240+
type: vm
241+
242+
pool:
243+
use: ubuntu
244+
245+
platform:
246+
os: linux
247+
arch: amd64
248+
249+
steps:
250+
- name: manifest
251+
image: plugins/manifest
252+
settings:
253+
ignore_missing: true
254+
password:
255+
from_secret: docker_password
256+
spec: docker/gar/manifest.tmpl
257+
username:
258+
from_secret: docker_username
259+
260+
trigger:
261+
ref:
262+
- refs/heads/master
263+
- "refs/tags/**"
264+
265+
depends_on:
266+
- windows-1809
267+
- windows-ltsc2022
268+
- linux-amd64-gar
269+
- linux-arm64-gar
270+
33271
---
34272

35273
kind: pipeline

docker/gar/Dockerfile.linux.amd64

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM plugins/buildx:linux-amd64
2+
3+
ADD release/linux/amd64/buildx-gar /bin/
4+
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/buildx-gar"]

docker/gar/Dockerfile.linux.arm64

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM plugins/buildx:linux-arm64
2+
3+
ADD release/linux/arm64/buildx-gar /bin/
4+
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/buildx-gar"]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# escape=`
2+
FROM plugins/buildx:windows-1809-amd64
3+
4+
LABEL maintainer="Drone.IO Community <[email protected]>" `
5+
org.label-schema.name="Drone GAR" `
6+
org.label-schema.vendor="Drone.IO Community" `
7+
org.label-schema.schema-version="1.0"
8+
9+
ADD release/windows/amd64/buildx-gar.exe C:/bin/buildx-gar.exe
10+
ENTRYPOINT [ "C:\\bin\\buildx-gar.exe" ]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# escape=`
2+
FROM plugins/buildx:windows-ltsc2022-amd64
3+
4+
LABEL maintainer="Drone.IO Community <[email protected]>" `
5+
org.label-schema.name="Drone GAR" `
6+
org.label-schema.vendor="Drone.IO Community" `
7+
org.label-schema.schema-version="1.0"
8+
9+
ADD release/windows/amd64/buildx-gar.exe C:/bin/buildx-gar.exe
10+
ENTRYPOINT [ "C:\\bin\\buildx-gar.exe" ]

docker/gar/manifest.tmpl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
image: plugins/buildx-gar:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
2+
{{#if build.tags}}
3+
tags:
4+
{{#each build.tags}}
5+
- {{this}}
6+
{{/each}}
7+
{{/if}}
8+
manifests:
9+
-
10+
image: plugins/buildx-gar:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
11+
platform:
12+
architecture: amd64
13+
os: linux
14+
-
15+
image: plugins/buildx-gar:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
16+
platform:
17+
architecture: arm64
18+
os: linux
19+
variant: v8
20+
-
21+
image: plugins/buildx-gar:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
22+
platform:
23+
architecture: amd64
24+
os: windows
25+
version: 1809
26+
-
27+
image: plugins/buildx-gar:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-ltsc2022-amd64
28+
platform:
29+
architecture: amd64
30+
os: windows
31+
version: ltsc2022

0 commit comments

Comments
 (0)