2023-08-27 18:02:51 +02:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ansible-semaphore/semaphore/services/runners"
|
2023-08-29 00:51:04 +02:00
|
|
|
"github.com/ansible-semaphore/semaphore/util"
|
2023-08-27 18:02:51 +02:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(runnerCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
func runRunner() {
|
2023-08-29 00:51:04 +02:00
|
|
|
util.ConfigInit(configPath)
|
2023-08-27 18:02:51 +02:00
|
|
|
|
|
|
|
taskPool := runners.JobPool{}
|
|
|
|
|
2023-08-29 00:51:04 +02:00
|
|
|
taskPool.Run()
|
2023-08-27 18:02:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var runnerCmd = &cobra.Command{
|
|
|
|
Use: "runner",
|
|
|
|
Short: "Run in runner mode",
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
runRunner()
|
|
|
|
},
|
|
|
|
}
|