chore(runner): remove update runner status

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-11-19 09:10:52 +08:00
committed by Jason Song
parent 8f950ccec0
commit e9e42e850b
6 changed files with 17 additions and 106 deletions

View File

@ -3,12 +3,7 @@ package cmd
import (
"context"
"os"
"strconv"
"gitea.com/gitea/act_runner/engine"
"gitea.com/gitea/act_runner/runtime"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@ -25,16 +20,12 @@ func Execute(ctx context.Context) {
// ./act_runner
rootCmd := &cobra.Command{
Use: "act [event name to run]\nIf no event name passed, will default to \"on: push\"",
Short: "Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly.",
Args: cobra.MaximumNArgs(1),
// RunE: runRoot(ctx, task),
Use: "act [event name to run]\nIf no event name passed, will default to \"on: push\"",
Short: "Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly.",
Args: cobra.MaximumNArgs(1),
Version: version,
SilenceUsage: true,
}
//rootCmd.Flags().BoolP("run", "r", false, "run workflows")
//rootCmd.Flags().StringP("job", "j", "", "run job")
//rootCmd.PersistentFlags().StringVarP(&task.Input.ForgeInstance, "forge-instance", "", "github.com", "Forge instance to use.")
rootCmd.PersistentFlags().StringVarP(&gArgs.EnvFile, "env-file", "", ".env", "Read in a file of environment variables.")
// ./act_runner register
@ -69,22 +60,3 @@ func Execute(ctx context.Context) {
os.Exit(1)
}
}
func runRoot(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command, args []string) error {
return func(cmd *cobra.Command, args []string) error {
jobID, err := cmd.Flags().GetString("job")
if err != nil {
return err
}
// try to connect to docker daemon
// if failed, exit with error
if err := engine.Start(ctx); err != nil {
log.WithError(err).Fatalln("failed to connect docker daemon engine")
}
task.BuildID, _ = strconv.ParseInt(jobID, 10, 64)
_ = task.Run(ctx, nil)
return nil
}
}