cmd

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetSSHCommand = &cobra.Command{
	Use:   "get-ssh-command",
	Short: "Constructs and returns the SSH command based on the running Gerrit instance.",
	RunE: func(cmd *cobra.Command, args []string) error {
		path := getString(cmd, "json")
		if path == "" {
			return errors.New("--json not provided")
		}

		info, err := gerrittest.LoadJSON(path)
		if err != nil {
			return err
		}

		sshcmd, err := gerrittest.GetSSHCommand(info)
		if err != nil {
			return err
		}
		fmt.Println(sshcmd)
		return nil
	},
}

GetSSHCommand returns a command to run to connect over ssh.

View Source
var Start = &cobra.Command{
	Use:   "start",
	Short: "Responsible for starting an instance of Gerrit.",
	RunE: func(cmd *cobra.Command, args []string) error {
		cfg, err := newStartConfig(cmd)
		if err != nil {
			return err
		}
		gerrit, err := gerrittest.New(cfg)
		if err != nil {
			return gerrit.Destroy()
		}
		return jsonOutput(cmd, gerrit)
	},
}

Start implements the `start` subcommand.

View Source
var Stop = &cobra.Command{
	Use:   "stop",
	Short: "Responsible for stopping an instance of Gerrit.",
	RunE: func(cmd *cobra.Command, args []string) error {
		path := getString(cmd, "json")
		if path == "" {
			return errors.New("--json not provided")
		}

		instance, err := gerrittest.NewFromJSON(path)
		if err != nil {
			return err
		}
		return instance.Destroy()
	},
}

Stop implements the `stop` subcommand.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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