Commit df1bee36 authored by Lucas Jenss's avatar Lucas Jenss

Add command to list configured runners

parent 1979541f
package commands
import (
log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"gitlab.com/gitlab-org/gitlab-ci-multi-runner/common"
)
type ListCommand struct {
configOptions
}
func (c *ListCommand) Execute(context *cli.Context) {
err := c.loadConfig()
if err != nil {
log.Warningln(err)
return
}
log.WithFields(log.Fields{
"ConfigFile": c.ConfigFile,
}).Println("Listing configured runners")
for _, runner := range c.config.Runners {
log.WithFields(log.Fields{
"Executor": runner.RunnerSettings.Executor,
"Token": runner.RunnerCredentials.Token,
"URL": runner.RunnerCredentials.URL,
}).Println(runner.Name)
}
}
func init() {
common.RegisterCommand2("list", "List all configured runners", &ListCommand{})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment