mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-23 06:48:00 +02:00
add forgeinstance
This commit is contained in:
@ -20,11 +20,11 @@ import (
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func runDaemon(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command, args []string) error {
|
||||
func runDaemon(ctx context.Context, envFile string) func(cmd *cobra.Command, args []string) error {
|
||||
return func(cmd *cobra.Command, args []string) error {
|
||||
log.Infoln("Starting runner daemon")
|
||||
|
||||
_ = godotenv.Load(task.Input.EnvFile)
|
||||
_ = godotenv.Load(envFile)
|
||||
cfg, err := config.FromEnviron()
|
||||
if err != nil {
|
||||
log.WithError(err).
|
||||
@ -101,9 +101,10 @@ func runDaemon(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command,
|
||||
)
|
||||
|
||||
runner := &runtime.Runner{
|
||||
Client: cli,
|
||||
Machine: cfg.Runner.Name,
|
||||
Environ: cfg.Runner.Environ,
|
||||
Client: cli,
|
||||
Machine: cfg.Runner.Name,
|
||||
ForgeInstance: cfg.ForgeInstance,
|
||||
Environ: cfg.Runner.Environ,
|
||||
}
|
||||
|
||||
poller := poller.New(
|
||||
|
@ -33,7 +33,7 @@ func initLogging(cfg config.Config) {
|
||||
}
|
||||
|
||||
func Execute(ctx context.Context) {
|
||||
task := runtime.NewTask(0, nil)
|
||||
task := runtime.NewTask("gitea", 0, nil)
|
||||
|
||||
// ./act_runner
|
||||
rootCmd := &cobra.Command{
|
||||
@ -54,7 +54,7 @@ func Execute(ctx context.Context) {
|
||||
Aliases: []string{"daemon"},
|
||||
Use: "execute runner daemon",
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
RunE: runDaemon(ctx, task),
|
||||
RunE: runDaemon(ctx, task.Input.EnvFile),
|
||||
}
|
||||
// add all command
|
||||
rootCmd.AddCommand(daemonCmd)
|
||||
|
Reference in New Issue
Block a user