rake

package
v0.0.0-...-966d904 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = models.Command{
	Name:      "rake",
	ShortHelp: "Execute a rake task",
	LongHelp: "<code>rake</code> executes a rake task by its name asynchronously. " +
		"Once executed, the output of the task can be seen through your logging Dashboard. Here is a sample command\n\n" +
		"<pre>\ndatica -E \"<your_env_name>\" rake code-1 db:migrate\n</pre>",
	CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) {
		return func(cmd *cli.Cmd) {
			serviceName := cmd.StringArg("SERVICE_NAME", "", "The service that will run the rake task.")
			taskName := cmd.StringArg("TASK_NAME", "", "The name of the rake task to run")
			cmd.Action = func() {
				if _, err := auth.New(settings, prompts.New()).Signin(); err != nil {
					logrus.Fatal(err.Error())
				}
				if err := config.CheckRequiredAssociation(settings); err != nil {
					logrus.Fatal(err.Error())
				}
				err := CmdRake(*serviceName, *taskName, New(settings), services.New(settings))
				if err != nil {
					logrus.Fatal(err.Error())
				}
			}
			cmd.Spec = "SERVICE_NAME TASK_NAME"
		}
	},
}

Cmd is the contract between the user and the CLI. This specifies the command name, arguments, and required/optional arguments and flags for the command.

Functions

func CmdRake

func CmdRake(svcName, taskName string, ir IRake, is services.IServices) error

Types

type IRake

type IRake interface {
	Run(taskName, svcID string) error
}

IRake

func New

func New(settings *models.Settings) IRake

New returns an instance of IRake

type SRake

type SRake struct {
	Settings *models.Settings
}

SRake is a concrete implementation of IRake

func (*SRake) Run

func (r *SRake) Run(taskName, svcID string) error

Run executes a rake task. This is only applicable for ruby-based applications.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL