-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path.kres.yaml
285 lines (285 loc) · 7.63 KB
/
.kres.yaml
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
kind: golang.Generate
spec:
versionPackagePath: internal/version
---
kind: golang.Build
spec:
outputs:
linux-amd64:
GOOS: linux
GOARCH: amd64
linux-arm64:
GOOS: linux
GOARCH: arm64
---
kind: golang.Toolchain
spec:
makefile:
extraVariables:
- name: PKGS_PREFIX
defaultValue: ghcr.io/siderolabs
- name: PKGS
defaultValue: v1.10.0-alpha.0-49-g347ad26
docker:
extraArgs:
- PKGS_PREFIX
- PKGS
---
kind: common.Docker
spec:
extraBuildArgs:
- PKGS_PREFIX
- PKGS
---
kind: common.Image
name: image-image-factory
spec:
extraEnvironment:
PLATFORM: linux/amd64,linux/arm64
additionalImages: [] # so we copy same fhs and ca-certificates as the version of other tools
allowedLocalPaths:
- tailwind.config.js
- package.json
- package-lock.json
dependsOn:
- tailwind
entrypoint: /usr/bin/image-factory
copyFrom:
- name: pkg-fhs
stage: ${PKGS_PREFIX}/fhs:${PKGS}
source: /
destination: /
- name: pkg-ca-certificates
stage: ${PKGS_PREFIX}/ca-certificates:${PKGS}
source: /
destination: /
- name: pkg-musl
stage: ${PKGS_PREFIX}/musl:${PKGS}
source: /
destination: /
- name: pkg-cpio
stage: ${PKGS_PREFIX}/cpio:${PKGS}
source: /
destination: /
- name: pkg-dosfstools
stage: ${PKGS_PREFIX}/dosfstools:${PKGS}
source: /
destination: /
- name: pkg-grub
stage: ${PKGS_PREFIX}/grub:${PKGS}
source: /
destination: /
- name: pkg-grub-amd64
stage: ${PKGS_PREFIX}/grub:${PKGS}
platform: linux/amd64
source: /usr/lib/grub
destination: /usr/lib/grub
- name: pkg-grub-arm64
stage: ${PKGS_PREFIX}/grub:${PKGS}
platform: linux/arm64
source: /usr/lib/grub
destination: /usr/lib/grub
- name: pkg-grub-unicode
stage: ghcr.io/siderolabs/installer:v1.9.4
source: /usr/share/grub/unicode.pf2
destination: /usr/share/grub/unicode.pf2
- name: pkg-kmod
stage: ${PKGS_PREFIX}/kmod:${PKGS}
source: /
destination: /
- name: pkg-libattr
stage: ${PKGS_PREFIX}/libattr:${PKGS}
source: /
destination: /
- name: pkg-lininih
stage: ${PKGS_PREFIX}/libinih:${PKGS}
source: /
destination: /
- name: pkg-liblzma
stage: ${PKGS_PREFIX}/liblzma:${PKGS}
source: /
destination: /
- name: pkg-linurcu
stage: ${PKGS_PREFIX}/liburcu:${PKGS}
source: /
destination: /
- name: pkg-openssl
stage: ${PKGS_PREFIX}/openssl:${PKGS}
source: /
destination: /
- name: pkg-xfsprogs
stage: ${PKGS_PREFIX}/xfsprogs:${PKGS}
source: /
destination: /
- name: pkg-e2fsprogs
stage: ${PKGS_PREFIX}/e2fsprogs:${PKGS}
source: /
destination: /
- name: pkg-glib
stage: ${PKGS_PREFIX}/glib:${PKGS}
source: /
destination: /
- name: pkg-linburn
stage: ${PKGS_PREFIX}/libburn:${PKGS}
source: /
destination: /
- name: pkg-libisoburn
stage: ${PKGS_PREFIX}/libisoburn:${PKGS}
source: /
destination: /
- name: pkg-linisofs
stage: ${PKGS_PREFIX}/libisofs:${PKGS}
source: /
destination: /
- name: pkg-mtools
stage: ${PKGS_PREFIX}/mtools:${PKGS}
source: /
destination: /
- name: pkg-pcre2
stage: ${PKGS_PREFIX}/pcre2:${PKGS}
source: /
destination: /
- name: pkg-pigz
stage: ${PKGS_PREFIX}/pigz:${PKGS}
source: /
destination: /
- name: pkg-qemu-tools
stage: ${PKGS_PREFIX}/qemu-tools:${PKGS}
source: /
destination: /
- name: pkg-squashfs-tools
stage: ${PKGS_PREFIX}/squashfs-tools:${PKGS}
source: /
destination: /
- name: pkg-tar
stage: ${PKGS_PREFIX}/tar:${PKGS}
source: /
destination: /
- name: pkg-xz
stage: ${PKGS_PREFIX}/xz:${PKGS}
source: /
destination: /
- name: pkg-zlib
stage: ${PKGS_PREFIX}/zlib:${PKGS}
source: /
destination: /
- name: pkg-zstd
stage: ${PKGS_PREFIX}/zstd:${PKGS}
source: /
destination: /
---
kind: auto.CustomSteps
spec:
steps:
- name: integration.test
toplevel: true
- name: integration
toplevel: true
- name: tailwind
toplevel: true
---
kind: custom.Step
name: integration.test
spec:
docker:
enabled: true
stages:
- name: integration-build
description: builds the integration test binary
from: base
steps:
- script:
command: go test -c -covermode=atomic -coverpkg=./... -tags integration ./internal/integration
cache:
- /root/.cache/go-build
- /go/pkg
- name: integration.test
description: copies out the integration test binary
steps:
- copy:
from: integration-build
src: /src/integration.test
dst: /integration.test
makefile:
enabled: true
phony: true
script:
- "@$(MAKE) local-$@ DEST=$(ARTIFACTS)"
---
kind: custom.Step
name: integration
spec:
makefile:
enabled: true
phony: true
depends:
- integration.test
variables:
- name: RUN_TESTS
defaultValue: TestIntegration
- name: TEST_FLAGS
defaultValue: ""
script:
- "@$(MAKE) image-image-factory PUSH=true"
- docker pull $(REGISTRY)/$(USERNAME)/image-factory:$(TAG)
- docker run --rm --net=host --privileged -v /dev:/dev -v $(PWD)/$(ARTIFACTS)/integration.test:/bin/integration.test:ro --entrypoint /bin/integration.test $(REGISTRY)/$(USERNAME)/image-factory:$(TAG) -test.v $(TEST_FLAGS) -test.run $(RUN_TESTS)
ghaction:
enabled: true
environment:
REGISTRY: registry.dev.siderolabs.io
TEST_FLAGS: "-test.schematic-service-repository=registry.dev.siderolabs.io/image-factory/schematic -test.installer-external-repository=registry.dev.siderolabs.io/siderolabs -test.installer-internal-repository=registry.dev.siderolabs.io/siderolabs -test.cache-repository=registry.dev.siderolabs.io/image-factory/cache"
---
kind: common.Build
spec:
ignoredPaths:
- node_modules/
---
kind: service.CodeCov
spec:
targetThreshold: 9 # the actual coverage is much higher and reported from the integration test
---
kind: custom.Step
name: tailwind
spec:
makefile:
enabled: true
phony: true
script:
- "@$(MAKE) local-tailwind-copy PUSH=false DEST=. PLATFORM=$(OPERATING_SYSTEM)/$(GOARCH)"
docker:
description: "Runs tailwind update"
enabled: true
stages:
- name: tailwind-base
description: "Installs tailwindcss"
from: docker.io/oven/bun:1.2.4-alpine
workdir: /src
steps:
- copy:
src: package.json package-lock.json
dst: .
- script:
cache:
- /src/node_modules
command: bun install
- name: tailwind-update
description: "tailwind update"
from: tailwind-base
steps:
- copy:
src: tailwind.config.js
dst: .
- copy:
src: internal/frontend/http
dst: internal/frontend/http
- script:
cache:
- /src/node_modules
command: node_modules/.bin/tailwindcss -i internal/frontend/http/css/input.css -o internal/frontend/http/css/output.css --minify
- name: tailwind-copy
description: "Copies assets"
steps:
- copy:
from: tailwind-update
src: /src/internal/frontend/http/css/output.css
dst: internal/frontend/http/css/output.css