shell

package
v0.0.0-...-900fa13 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2015 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ShellPluginName = "shell"
	ShellExecCmd    = "exec"
	CleanupCmd      = "cleanup"
	TrackCmd        = "track"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupCommand

type CleanupCommand struct{}

func (*CleanupCommand) Execute

func (cc *CleanupCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator,
	conf *model.TaskConfig,
	stop chan bool) error

Execute starts the shell with its given parameters.

func (*CleanupCommand) Name

func (cc *CleanupCommand) Name() string

func (*CleanupCommand) ParseParams

func (cc *CleanupCommand) ParseParams(params map[string]interface{}) error

ParseParams reads in the command's parameters.

func (*CleanupCommand) Plugin

func (cc *CleanupCommand) Plugin() string

type ShellExecCommand

type ShellExecCommand struct {
	// Script is the shell code to be run on the agent machine.
	Script string `mapstructure:"script" plugin:"expand"`

	// Silent, if set to true, prevents shell code/output from being
	// logged to the agent's task logs. This can be used to avoid
	// exposing sensitive expansion parameters and keys.
	Silent bool `mapstructure:"silent"`

	// Background, if set to true, prevents shell code/output from
	// waiting for the script to complete and immediately returns
	// to the caller
	Background bool `mapstructure:"background"`

	// WorkingDir is the working directory to start the shell in.
	WorkingDir string `mapstructure:"working_dir"`

	// ContinueOnError determines whether or not a failed return code
	// should cause the task to be marked as failed. Setting this to true
	// allows following commands to execute even if this shell command fails.
	ContinueOnError bool `mapstructure:"continue_on_err"`
}

ShellExecCommand is responsible for running the shell code.

func (*ShellExecCommand) Execute

func (self *ShellExecCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator,
	conf *model.TaskConfig,
	stop chan bool) error

Execute starts the shell with its given parameters.

func (*ShellExecCommand) Name

func (self *ShellExecCommand) Name() string

func (*ShellExecCommand) ParseParams

func (self *ShellExecCommand) ParseParams(params map[string]interface{}) error

ParseParams reads in the command's parameters.

func (*ShellExecCommand) Plugin

func (self *ShellExecCommand) Plugin() string

type ShellPlugin

type ShellPlugin struct{}

ShellPlugin runs arbitrary shell code on the agent's machine.

func (*ShellPlugin) Configure

func (self *ShellPlugin) Configure(map[string]interface{}) error

func (*ShellPlugin) GetAPIHandler

func (self *ShellPlugin) GetAPIHandler() http.Handler

GetRoutes is required by the Plugin interface. This plugin has no API routes.

func (*ShellPlugin) GetPanelConfig

func (self *ShellPlugin) GetPanelConfig() (*plugin.PanelConfig, error)

GetPanelConfig is required by the Plugin interface. This plugin has no UI presence.

func (*ShellPlugin) GetUIHandler

func (self *ShellPlugin) GetUIHandler() http.Handler

func (*ShellPlugin) Name

func (self *ShellPlugin) Name() string

Name returns the name of the plugin. Required to fulfill the Plugin interface.

func (*ShellPlugin) NewCommand

func (self *ShellPlugin) NewCommand(cmdName string) (plugin.Command, error)

NewCommand returns the requested command, or returns an error if a non-existing command is requested.

type TrackCommand

type TrackCommand struct{}

func (*TrackCommand) Execute

func (cc *TrackCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator, conf *model.TaskConfig, stop chan bool) error

Execute starts the shell with its given parameters.

func (*TrackCommand) Name

func (cc *TrackCommand) Name() string

func (*TrackCommand) ParseParams

func (cc *TrackCommand) ParseParams(params map[string]interface{}) error

func (*TrackCommand) Plugin

func (cc *TrackCommand) Plugin() string

Jump to

Keyboard shortcuts

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