diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-09-29 23:56:37 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-09-30 16:04:48 +0900 |
| commit | b94e6faa9d20dab9b179ee40b5f749c7f13d3f9a (patch) | |
| tree | 519f48fcbf21bd59e1b2384ae977132661f0a324 /cmd/mbf/main.go | |
| parent | d65adbd06033147fa7ffb5c1b919ab4f40e68b83 (diff) | |
cmd/mbf: proof-of-concept CI servicedevelop
This accepts CI work over a shared read-only cache directory. This
replaces the nix CI service and prepares the removal of nix from the
test infrastructure.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/mbf/main.go')
| -rw-r--r-- | cmd/mbf/main.go | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 22bfbc3e..014a7f47 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -43,6 +43,7 @@ import ( "hakurei.app/message" "hakurei.app/pkg" + "hakurei.app/cmd/mbf/internal/ci" "hakurei.app/cmd/mbf/internal/pkgsite" "hakurei.app/cmd/mbf/internal/pkgsite/ui" ) @@ -504,7 +505,7 @@ func main() { c.NewCommand( "daemon", "Service artifact IR with Rosa OS extensions", - func(args []string) error { + func([]string) error { ul, err := net.ListenUnix("unix", &addr) if err != nil { return err @@ -514,6 +515,40 @@ func main() { }, ) + _ci := c.New("ci", command.UsageInternal) + _ci.NewCommand( + "daemon", + "Service CI workload dispatched through the socket", + func([]string) error { + return cm.Do(func(cache *pkg.Cache) error { + return ci.Serve(ctx, msg, cache) + }) + }, + ) + { + var flagOutput string + _ci.NewCommand( + "dist", + "Request distribution tarball for the specified source directory", + func(args []string) error { + if len(args) != 2 { + return errors.New("dist requires 2 arguments") + } + + return ci.Path(cm.base).MakeDist( + ctx, + os.Stdout, + flagOutput, + args[0], args[1], + ) + }, + ).Flag( + &flagOutput, + "o", command.StringFlag("."), + "Write the resulting distribution to the named directory", + ) + } + c.NewCommand( "keygen", "Create keypair for local cache", |
