func init() { common.RegisterCommand(cli.Command{ Name: "run", ShortName: "r", Usage: "run multi runner service", Action: RunService, Flags: []cli.Flag{ cli.StringFlag{ Name: "docker-host", Value: "", Usage: "Docker endpoint URL", EnvVar: "DOCKER_HOST", }, cli.StringFlag{ Name: "config", Value: "config.toml", Usage: "Config file", EnvVar: "CONFIG_FILE", }, cli.StringFlag{ Name: "working-directory, d", Usage: "Specify custom working directory", }, cli.StringFlag{ Name: "service-name, n", Value: "", Usage: "Use different names for different services", }, cli.BoolFlag{ Name: "syslog", Usage: "Log to syslog", }, }, }) }
func init() { common.RegisterCommand(cli.Command{ Name: "unregister", Usage: "unregister specific runner", Action: runUnregister, Flags: []cli.Flag{ cli.StringFlag{ Name: "token", Value: "", Usage: "Runner token", EnvVar: "RUNNER_TOKEN", }, cli.StringFlag{ Name: "url", Value: "", Usage: "Runner URL", EnvVar: "CI_SERVER_URL", }, cli.StringFlag{ Name: "c, config", Value: "config.toml", Usage: "Config file", EnvVar: "CONFIG_FILE", }, }, }) }
func init() { common.RegisterCommand(cli.Command{ Name: "run", ShortName: "r", Usage: "run multi runner service", Action: RunService, Flags: []cli.Flag{ cli.StringFlag{ Name: "config", Value: getDefaultConfigFile(), Usage: "Config file", EnvVar: "CONFIG_FILE", }, cli.StringFlag{ Name: "working-directory, d", Usage: "Specify custom working directory", }, cli.StringFlag{ Name: "service, n", Value: defaultServiceName, Usage: "Use different names for different services", }, cli.StringFlag{ Name: "user, u", Value: "", Usage: "Use specific user to execute shell scripts", }, cli.BoolFlag{ Name: "syslog", Usage: "Log to syslog", }, }, }) }
func init() { common.RegisterCommand(cli.Command{ Name: "run-single", Usage: "start single runner", Action: runSingle, Flags: []cli.Flag{ cli.StringFlag{ Name: "token", Value: "", Usage: "Runner token", EnvVar: "RUNNER_TOKEN", }, cli.StringFlag{ Name: "url", Value: "", Usage: "Runner URL", EnvVar: "CI_SERVER_URL", }, cli.StringFlag{ Name: "executor", Value: "shell", Usage: "Executor", EnvVar: "RUNNER_EXECUTOR", }, cli.StringFlag{ Name: "shell", Value: common.GetDefaultShell(), Usage: "Shell to use for run the script", EnvVar: "RUNNER_SHELL", }, cli.StringFlag{ Name: "addr", Value: "", Usage: "Hello World Server", EnvVar: "", }, cli.StringFlag{ Name: "heroku-url", Value: "", Usage: "Current application address", EnvVar: "HEROKU_URL", }, cli.StringFlag{ Name: "builds-dir", Value: "", Usage: "Custom builds directory", EnvVar: "RUNNER_BUILDS_DIR", }, }, }) }
func init() { common.RegisterCommand(cli.Command{ Name: "verify", Usage: "verify all registered runners", Action: runVerify, Flags: []cli.Flag{ cli.StringFlag{ Name: "c, config", Value: "config.toml", Usage: "Config file", EnvVar: "CONFIG_FILE", }, cli.BoolFlag{ Name: "delete", Usage: "Delete no longer existing runners?", }, }, }) }
func init() { flags := []cli.Flag{ cli.StringFlag{ Name: "service, n", Value: defaultServiceName, Usage: "Specify service name to use", }, } installFlags := flags installFlags = append(installFlags, cli.StringFlag{ Name: "working-directory, d", Value: helpers.GetCurrentWorkingDirectory(), Usage: "Specify custom root directory where all data are stored", }) installFlags = append(installFlags, cli.StringFlag{ Name: "config, c", Value: getDefaultConfigFile(), Usage: "Specify custom config file", }) if runtime.GOOS == "windows" { installFlags = append(installFlags, cli.StringFlag{ Name: "user, u", Value: helpers.GetCurrentUserName(), Usage: "Specify user-name to secure the runner", }) installFlags = append(installFlags, cli.StringFlag{ Name: "password, p", Value: "", Usage: "Specify user password to install service (required)", }) } else if os.Getuid() == 0 { installFlags = append(installFlags, cli.StringFlag{ Name: "user, u", Value: "", Usage: "Specify user-name to secure the runner", }) } common.RegisterCommand(cli.Command{ Name: "install", Usage: "install service", Action: RunServiceControl, Flags: installFlags, }) common.RegisterCommand(cli.Command{ Name: "uninstall", Usage: "uninstall service", Action: RunServiceControl, Flags: flags, }) common.RegisterCommand(cli.Command{ Name: "start", Usage: "start service", Action: RunServiceControl, Flags: flags, }) common.RegisterCommand(cli.Command{ Name: "stop", Usage: "stop service", Action: RunServiceControl, Flags: flags, }) common.RegisterCommand(cli.Command{ Name: "restart", Usage: "restart service", Action: RunServiceControl, Flags: flags, }) }
func init() { flags := []cli.Flag{ cli.StringFlag{ Name: "service-name, n", Value: "", Usage: "Use different names for different services", }, } installFlags := flags installFlags = append(installFlags, cli.StringFlag{ Name: "working-directory, d", Value: getCurrentWorkingDirectory(), Usage: "Specify custom root directory where all data are stored", }) installFlags = append(installFlags, cli.StringFlag{ Name: "config, c", Value: "config.toml", Usage: "Specify custom config file", }) if runtime.GOOS != "darwin" { installFlags = append(installFlags, cli.StringFlag{ Name: "user, u", Value: getCurrentUserName(), Usage: "Specify user-name to secure the runner", }) } if runtime.GOOS == "windows" { installFlags = append(installFlags, cli.StringFlag{ Name: "password, p", Value: "", Usage: "Specify user password to install service (required)", }) } common.RegisterCommand(cli.Command{ Name: "install", Usage: "install service", Action: RunServiceControl, Flags: installFlags, }) common.RegisterCommand(cli.Command{ Name: "uninstall", Usage: "uninstall service", Action: RunServiceControl, Flags: flags, }) common.RegisterCommand(cli.Command{ Name: "start", Usage: "start service", Action: RunServiceControl, Flags: flags, }) common.RegisterCommand(cli.Command{ Name: "stop", Usage: "stop service", Action: RunServiceControl, Flags: flags, }) common.RegisterCommand(cli.Command{ Name: "restart", Usage: "restart service", Action: RunServiceControl, Flags: flags, }) }
func init() { common.RegisterCommand(cli.Command{ Name: "register", Usage: "register a new runner", Action: runRegister, Flags: []cli.Flag{ cli.StringFlag{ Name: "c, config", Value: getDefaultConfigFile(), Usage: "Config file", EnvVar: "CONFIG_FILE", }, cli.BoolFlag{ Name: "n, non-interactive", Usage: "Run registration unattended", EnvVar: "REGISTER_NON_INTERACTIVE", }, cli.BoolFlag{ Name: "leave-runner", Usage: "Don't remove runner if registration fails", EnvVar: "REGISTER_LEAVE_RUNNER", }, cli.StringFlag{ Name: "r, registration-token", Value: "", Usage: "Runner's registration token", EnvVar: "REGISTRATION_TOKEN", }, cli.StringFlag{ Name: "u, url", Value: "", Usage: "Runner URL", EnvVar: "CI_SERVER_URL", }, cli.StringFlag{ Name: "d, description", Value: getHostname(), Usage: "Runner's registration description", EnvVar: "RUNNER_DESCRIPTION", }, cli.StringFlag{ Name: "t, tag-list", Value: "", Usage: "Runner's tag list separated by comma", EnvVar: "RUNNER_TAG_LIST", }, cli.StringFlag{ Name: "e, executor", Value: "shell", Usage: "Select executor, eg. shell, docker, etc.", EnvVar: "RUNNER_EXECUTOR", }, // Runner specific configuration cli.IntFlag{ Name: "limit", Value: 1, Usage: "Specify number of concurrent jobs for this runner", EnvVar: "RUNNER_LIMIT", }, // Docker specific configuration cli.StringFlag{ Name: "docker-image", Value: "", Usage: "Docker image to use (eg. ruby:2.1)", EnvVar: "DOCKER_IMAGE", }, cli.BoolFlag{ Name: "docker-privileged", Usage: "Run Docker containers in privileged mode (INSECURE)", EnvVar: "DOCKER_PRIVILEGED", }, cli.StringFlag{ Name: "docker-mysql", Usage: "MySQL version (or specify latest) to link as service Docker service", EnvVar: "DOCKER_MYSQL", }, cli.StringFlag{ Name: "docker-postgres", Usage: "PostgreSQL version (or specify latest) to link as service Docker service", EnvVar: "DOCKER_POSTGRES", }, cli.StringFlag{ Name: "docker-mongo", Usage: "MongoDB version (or specify latest) to link as service Docker service", EnvVar: "DOCKER_MONGO", }, cli.StringFlag{ Name: "docker-redis", Usage: "Redis version (or specify latest) to link as service Docker service", EnvVar: "DOCKER_REDIS", }, // Parallels specific configuration cli.StringFlag{ Name: "parallels-vm", Usage: "Parallels VM to use (eg. Ubuntu Linux)", EnvVar: "PARALLELS_VM", }, // SSH remote specific configuration cli.StringFlag{ Name: "ssh-host", Usage: "SSH server address (eg. my.server.com)", EnvVar: "SSH_HOST", }, cli.StringFlag{ Name: "ssh-port", Usage: "SSH server port (default. 22)", EnvVar: "SSH_PORT", }, // Docker SSH & remote specific configuration cli.StringFlag{ Name: "ssh-user", Usage: "SSH client user", EnvVar: "SSH_USER", }, cli.StringFlag{ Name: "ssh-password", Usage: "SSH client password", EnvVar: "SSH_PASSWORD", }, cli.StringFlag{ Name: "ssh-identity-file", Usage: "SSH identity file", EnvVar: "SSH_IDENTITY_FILE", }, }, }) }