add forgeinstance

This commit is contained in:
Lunny Xiao
2022-10-16 23:51:53 +08:00
committed by Jason Song
parent 9c7d2be7c6
commit 378966e45f
7 changed files with 28 additions and 22 deletions

View File

@ -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(