@kbach Everything looks great except for the .gitlab-ci.yml
which I think needs a few tweaks to work correctly.
I don't think this will work as is, the reason being the doc files are within the built image and not on the local filesystem. The best way to get files out of the Blubber-built image is to:
buildctl
argument to export to the contents of the image. You can either do this with the BUILDCTL_BUILD_FLAGS
variable that Kokkuri supports, or by redefining the script:
.Something like this, although I haven't tested it.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5d32b28..0d408af 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -103,12 +103,14 @@ build-and-publish-frontend:
build-documentation:
variables:
- BUILD_VARIANT: build-docs
- DOCS_DIR: ./vitepress/dist
+ BUILD_VARIANT: docs-for-publishing
+ DOCS_DIR: ./tmp/docroot
extends:
- .kokkuri:build-image
- .docs-common
- .docpub:build-docs
+ script:
+ - kokkuri image build -- --output type=local,dest=./tmp/docroot
publish-documentation:
needs: [build-documentation]
diff --git a/.pipeline/blubber.yaml b/.pipeline/blubber.yaml
index bf074d2..cfa245f 100644
--- a/.pipeline/blubber.yaml
+++ b/.pipeline/blubber.yaml
@@ -68,6 +68,8 @@ variants:
build-docs:
base: docker-registry.wikimedia.org/nodejs18-devel:0.0.1-20240303
runs: { insecurely: true }
+ lives:
+ in: /src/docs
node:
use-npm-ci: true
requirements:
@@ -83,3 +85,8 @@ variants:
preview-docs:
includes: [build-docs]
entrypoint: [npm, run, docs:preview]
+ docs-for-publishing:
+ copies:
+ - from: build-docs
+ source: /src/docs/.vitepress/dist
+ destination: /
Ported all Blubber variants and .gitlab-ci.yml
jobs to Dagger
functions.
Functions can be listed using dagger functions
:
$ dagger functions
Name Description
base Base returns the base Blubber development container
build-container BuildContainer returns a container with all Go module dependencies
build-gateway BuildGateway builds the Blubber BuildKit frontend gateway
build-kitd BuildKitd returns a BuildKitd container for use in testing
lint Lint runs linters
test-container TestContainer returns a container with all test dependencies
test-examples TestExamples runs the executable examples
test-units TestUnits runs unit tests
toolchain Toolchain returns a container with system package dependencies
Functions can be run locally or against a remote Dagger Engine:
dagger call lint --src .
dagger call test-units --src .
dagger call test-examples --src .
dagger call build-gateway --src .
Getting a terminal for any of the containers is possible by chaining a
call to terminal
.
dagger call test-container --src . terminal
Dduvall (1f121bb6) at 12 Mar 21:02
draft: Experimenting with Dagger for image builds and CI
Nice!
Actually, scratch that. I think copying the files is fine. I doubt we will add files often enough that it becomes a real burden.
I love the preview-docs
variant! But let's keep it simple and just have everything in the root dir.
Dduvall (c992fb0f) at 08 Mar 22:33
Experimenting with Dagger modules
Dduvall (ca25c249) at 08 Mar 18:46
Initial commit
@kbach if you haven't already seen it, the docpub README contains an example on how to get docs published from the .gitlab-ci.yml
. @jnuche implemented it and knows the ins and outs.
On second thought, let's keep it in the root.
Dduvall (9da55ff4) at 13 Feb 17:44
Draft: Playing around with different config doc formatting
Dduvall (68504783) at 12 Feb 22:44
version: 0.22.0
Dduvall (d5ef111d) at 12 Feb 22:44
Dduvall (d5ef111d) at 12 Feb 22:44
version: 0.22.0
Change-Id: Icd46c2dcf400b7d3352862baa19b64ab9600b90d