feat: run official executor behind SPIFFE mTLS

This commit is contained in:
2026-09-20 20:12:03 +00:00
parent 8b77b4be63
commit 27599631f1
7 changed files with 199 additions and 8 deletions
+37
View File
@@ -0,0 +1,37 @@
package main
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"git.ddupan.top/panxiao81/gitea-dynamic-runner/internal/runnerbootstrap"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
if len(os.Args) != 2 {
return errors.New("usage: gitea-dynamic-runner executor")
}
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()
switch os.Args[1] {
case "executor":
config, err := runnerbootstrap.ExecutorConfigFromEnvironment()
if err != nil {
return err
}
return runnerbootstrap.RunExecutor(ctx, config)
default:
return fmt.Errorf("unknown command %q", os.Args[1])
}
}