-
Notifications
You must be signed in to change notification settings - Fork 0
/
wagon.cue
89 lines (77 loc) · 1.35 KB
/
wagon.cue
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
import (
"strings"
"wagon.octohelm.tech/core"
"github.com/innoai-tech/runtime/cuepkg/tool"
"github.com/innoai-tech/runtime/cuepkg/golang"
"github.com/innoai-tech/runtime/cuepkg/debian"
"github.com/innoai-tech/runtime/cuepkg/imagetool"
)
pkg: version: core.#Version
client: core.#Client & {
env: {
GH_USERNAME: string | *""
GH_PASSWORD: core.#Secret
}
}
setting: core.#Setting & {
registry: "ghcr.io": auth: {
username: client.env.GH_USERNAME
secret: client.env.GH_PASSWORD
}
}
actions: go: golang.#Project & {
version: "\(pkg.version.output)"
source: {
path: "."
include: [
"cmd/",
"pkg/",
"cuepkg/",
"internal/",
"go.mod",
"go.sum",
]
}
goos: [
"linux",
"darwin",
]
goarch: [
"amd64",
"arm64",
]
main: "./cmd/wagon"
ldflags: [
"-s -w",
"-X \(go.module)/internal/version.version=\(go.version)",
]
build: {
pre: [
"go mod download",
]
}
archive: archive: true
ship: {
name: "\(strings.Replace(go.module, "github.com/", "ghcr.io/", -1))/\(go.binary)"
from: "docker.io/library/debian:bookworm-slim"
steps: [
debian.#InstallPackage & {
packages: {
"git": _
"wget": _
"curl": _
"make": _
}
},
imagetool.#Shell & {
run: """
ln -s /wagon /bin/wagon
ln -s /wagon /bin/dagger
"""
},
]
config: {
entrypoint: ["/bin/sh"]
}
}
}