Skip to content

Commit 4e2f86f

Browse files
committed
add initial test
Signed-off-by: Danny Brito <[email protected]>
1 parent 11fd65f commit 4e2f86f

File tree

4 files changed

+550
-1
lines changed

4 files changed

+550
-1
lines changed

docker-bake.hcl

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,63 @@ target "examples" {
221221
tags = ["local/dalec/examples/${f}:${distro}"]
222222
}
223223

224+
target "go-stuff" {
225+
name = "examples-${f}-${tgt}"
226+
matrix = {
227+
distro = ["azlinux3"]
228+
f = ["simple-go-require"]
229+
tgt = ["sources", "patched-sources"]
230+
}
231+
args = {
232+
"BUILDKIT_SYNTAX" = "dalec_frontend"
233+
}
234+
contexts = {
235+
"dalec_frontend" = "target:frontend"
236+
}
237+
// target = "${distro}/container"
238+
// target = "debug/sources"
239+
target = "debug/${tgt}"
240+
dockerfile = "test/fixtures/${f}.yml"
241+
// tags = ["local/dralec/examples/${f}:${distro}"]
242+
output = [ "_src_${tgt}" ]
243+
244+
}
245+
target "go-azl3-container-stuff" {
246+
name = "examples-${f}-${tgt}"
247+
matrix = {
248+
distro = ["azlinux3"]
249+
f = ["simple-go-require"]
250+
tgt = ["rpm"]
251+
}
252+
args = {
253+
"BUILDKIT_SYNTAX" = "dalec_frontend"
254+
}
255+
contexts = {
256+
"dalec_frontend" = "target:frontend"
257+
}
258+
target = "${distro}/${tgt}"
259+
dockerfile = "test/fixtures/${f}.yml"
260+
tags = ["local/dalec/examples/${f}:${distro}"]
261+
output = [ "_src_${tgt}" ]
262+
263+
}
264+
target "godebugmod" {
265+
name = "godebugmod-examples-${replace(tgt, "/", "-")}-${f}"
266+
matrix = {
267+
f = ["simple-go-require"]
268+
tgt = ["azlinux3/rpm/debug/sources", "jammy/deb"]
269+
}
270+
args = {
271+
"BUILDKIT_SYNTAX" = "dalec_frontend"
272+
}
273+
contexts = {
274+
"dalec_frontend" = "target:frontend"
275+
}
276+
target = tgt
277+
dockerfile = "test/fixtures/${f}.yml"
278+
output = [ "_src_debug_gomods" ]
279+
}
280+
224281
target "deps-only" {
225282
name = "deps-only-${distro}"
226283
matrix = {
@@ -281,4 +338,3 @@ target "worker" {
281338
"dalec_frontend" = "target:frontend"
282339
}
283340
}
284-
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#syntax=local/dalec/frontend:test
2+
args:
3+
VERSION: 1.5.1
4+
COMMIT: a8ca31655b37214a6038a3e2a53b4c6d81ba21f5
5+
REVISION: 1
6+
7+
name: go-md2man
8+
version: ${VERSION}
9+
revision: ${REVISION}
10+
packager: Dalec Example
11+
vendor: Dalec Example
12+
license: MIT
13+
description: A tool to convert markdown into man pages (roff).
14+
website: https://github.com/cpuguy83/go-md2man
15+
16+
sources:
17+
src:
18+
generate:
19+
- gomod:
20+
edits:
21+
require:
22+
- github.com/russross/blackfriday/v2:github.com/russross/blackfriday/[email protected]
23+
git:
24+
url: https://github.com/cpuguy83/go-md2man.git
25+
commit: v2.0.0
26+
27+
autoscaler:
28+
generate:
29+
- gomod:
30+
paths:
31+
- vertical-pod-autoscaler
32+
- cluster-autoscaler
33+
edits:
34+
require:
35+
- github.com/spf13/pflag:github.com/spf13/[email protected]
36+
git:
37+
url: https://github.com/kubernetes/autoscaler.git
38+
commit: ${COMMIT}
39+
40+
dependencies:
41+
build:
42+
golang:
43+
44+
build:
45+
env:
46+
CGO_ENABLED: "0"
47+
steps:
48+
- command: |
49+
cd src
50+
go build -o go-md2man .
51+
- command: |
52+
set -xe
53+
cd autoscaler/vertical-pod-autoscaler
54+
# check that the go.mod is patched with the require directive
55+
grep -q "github.com/spf13/pflag v1.0.10" go.mod
56+
cat go.mod
57+
# verify the module cache exists
58+
test -d "${GOMODCACHE}/github.com/spf13/[email protected]"
59+
cd ../cluster-autoscaler
60+
cat go.mod
61+
grep -q "github.com/spf13/pflag v1.0.10" go.mod
62+
63+
artifacts:
64+
binaries:
65+
src/go-md2man:
66+
67+
image:
68+
entrypoint: go-md2man
69+
cmd: --help
70+
71+
tests:
72+
- name: Check bin
73+
files:
74+
/usr/bin/go-md2man:
75+
permissions: 0755

0 commit comments

Comments
 (0)