-
Notifications
You must be signed in to change notification settings - Fork 0
/
dagger.cue
165 lines (141 loc) · 2.93 KB
/
dagger.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
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
package main
import (
"strings"
"dagger.io/dagger"
"github.com/innoai-tech/runtime/cuepkg/tool"
"github.com/innoai-tech/runtime/cuepkg/node"
"github.com/innoai-tech/runtime/cuepkg/golang"
"github.com/innoai-tech/runtime/cuepkg/debian"
"github.com/innoai-tech/runtime/cuepkg/imagetool"
)
dagger.#Plan
client: env: {
VERSION: string | *"dev"
GIT_SHA: string | *""
GIT_REF: string | *""
GOPROXY: string | *""
GOPRIVATE: string | *""
GOSUMDB: string | *""
GH_USERNAME: string | *""
GH_PASSWORD: dagger.#Secret
LINUX_MIRROR: string | *""
CONTAINER_REGISTRY_PULL_PROXY: string | *""
}
actions: version: tool.#ResolveVersion & {
ref: "\(client.env.GIT_REF)"
version: "\(client.env.VERSION)"
}
auths: "ghcr.io": {
username: client.env.GH_USERNAME
secret: client.env.GH_PASSWORD
}
mirror: {
linux: client.env.LINUX_MIRROR
pull: client.env.CONTAINER_REGISTRY_PULL_PROXY
}
client: filesystem: "internal": write: contents: actions.webapp.build.output
actions: webapp: node.#Project & {
source: {
path: "."
include: [
"webapp/",
"nodepkg/",
".npmrc",
"pnpm-*.yaml",
"*.json",
]
exclude: [
"node_modules/",
]
}
env: "CI": "true"
build: {
outputs: {
"liveplayer/dist": "webapp/live-player/dist"
}
pre: [
"pnpm install",
]
script: "pnpm exec turbo run build"
image: {
"mirror": mirror
"steps": [
node.#ConfigPrivateRegistry & {
scope: "@innoai-tech"
host: "npm.pkg.github.com"
token: client.env.GH_PASSWORD
},
imagetool.#Script & {
run: [
"npm i -g pnpm",
]
},
]
}
}
}
client: filesystem: "build/output": write: contents: actions.go.archive.output
actions: go: golang.#Project & {
source: {
path: "."
include: [
"cmd/",
"pkg/",
"internal/",
"go.mod",
"go.sum",
]
}
version: "\(actions.version.output)"
revision: "\(client.env.GIT_SHA)"
cgo: true
goos: ["linux"]
goarch: ["amd64", "arm64"]
main: "./cmd/mtk"
ldflags: [
"-s -w",
"-X \(go.module)/pkg/version.Version=\(go.version)",
"-X \(go.module)/pkg/version.Revision=\(go.revision)",
]
env: {
GOPROXY: client.env.GOPROXY
GOPRIVATE: client.env.GOPRIVATE
GOSUMDB: client.env.GOSUMDB
}
build: {
pre: [
"go mod download",
]
image: steps: [
debian.#InstallPackage & {
packages: {
"libavformat-dev": _
"libavcodec-dev": _
"libavutil-dev": _
"libx264-dev": _
}
},
]
}
ship: {
name: "\(strings.Replace(go.module, "github.com/", "ghcr.io/", -1))"
from: "docker.io/library/debian:bullseye-slim"
steps: [
debian.#InstallPackage & {
packages: {
"libavcodec58": _
"libavformat58": _
"libavutil56": _
"libx264-160": _
}
},
]
config: {
cmd: ["serve"]
}
}
"auths": auths
"mirror": mirror
devkit: load: host: client.network."unix:///var/run/docker.sock".connect
}
client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket