mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
chore(runner): refactor register flow
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
7486d2ab91
commit
3a1503138b
8 changed files with 165 additions and 97 deletions
|
@ -5,8 +5,10 @@ import (
|
|||
"os"
|
||||
"strconv"
|
||||
|
||||
"gitea.com/gitea/act_runner/config"
|
||||
"gitea.com/gitea/act_runner/engine"
|
||||
"gitea.com/gitea/act_runner/runtime"
|
||||
|
||||
"github.com/mattn/go-isatty"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -15,7 +17,7 @@ import (
|
|||
const version = "0.1"
|
||||
|
||||
// initLogging setup the global logrus logger.
|
||||
func initLogging(cfg Config) {
|
||||
func initLogging(cfg config.Config) {
|
||||
isTerm := isatty.IsTerminal(os.Stdout.Fd())
|
||||
log.SetFormatter(&log.TextFormatter{
|
||||
DisableColors: !isTerm,
|
||||
|
@ -76,7 +78,7 @@ func runRoot(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command, a
|
|||
}
|
||||
|
||||
task.BuildID, _ = strconv.ParseInt(jobID, 10, 64)
|
||||
task.Run(ctx, nil)
|
||||
_ = task.Run(ctx, nil)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue