run

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Commands to generate and run new temporary SSM documents

Index

Constants

This section is empty.

Variables

View Source
var Commands = []cli.Command{
	{
		Name:   "command",
		Usage:  "Runs a given command against specified instances.",
		Action: runShellCommand,
		Before: func(c *cli.Context) error {
			if len(c.Args()) == 0 {
				return errors.New("missing command argument")
			}

			groups := []flagutil.ExclusiveFlagGroup{
				[]string{"instances"},
				[]string{"autoscale-group"},
				[]string{"tag-key", "tag-value"},
			}

			return flagutil.ValidateExclusiveFlagGroups(c, groups)
		},
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "alias, A",
				Usage: "Tells maestro the command being run is an alias set in the maestro config.",
			},
			autoscaleFlag,
			bucketNameFlag,
			instancesFlag,
			noCleanupFlag,
			platformTypeFlag,
			tagKeyFlag,
			tagValueFlag,
		},
	},
	{
		Name:   "document",
		Usage:  "Runs SSM Command document.",
		Action: runDocument,
		Before: func(c *cli.Context) error {
			if len(c.Args()) == 0 {
				return errors.New("missing document argument")
			}

			groups := []flagutil.ExclusiveFlagGroup{
				[]string{"instances"},
				[]string{"autoscale-group"},
				[]string{"tag-key", "tag-value"},
			}

			return flagutil.ValidateExclusiveFlagGroups(c, groups)
		},
		Flags: []cli.Flag{
			autoscaleFlag,
			bucketNameFlag,
			instancesFlag,
			noCleanupFlag,
			parametersFlag,
			paramDelimiterFlag,
			tagKeyFlag,
			tagValueFlag,
		},
	},
	{
		Name:  "script",
		Usage: "Runs a given script as an SSM document on provided instances",
		Before: func(c *cli.Context) error {
			if len(c.Args()) == 0 {
				return errors.New("missing script argument")
			}

			groups := []flagutil.ExclusiveFlagGroup{
				[]string{"instances"},
				[]string{"autoscale-group"},
				[]string{"tag-key", "tag-value"},
			}

			return flagutil.ValidateExclusiveFlagGroups(c, groups)
		},
		Action: runShellScript,
		Flags: []cli.Flag{
			autoscaleFlag,
			bucketNameFlag,
			instancesFlag,
			noCleanupFlag,
			platformTypeFlag,
			tagKeyFlag,
			tagValueFlag,
		},
	},
}

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