configurepackage

package
v0.0.0-...-7638cb1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package configurepackage implements the ConfigurePackage plugin.

Package configurepackage implements the ConfigurePackage plugin. configurepackage_deps contains platform dependencies that should be able to be stubbed out in tests

Package configurepackage implements the ConfigurePackage plugin.

Package configurepackage implements the ConfigurePackage plugin.

Package configurepackage implements the ConfigurePackage plugin.

Package configurepackage implements the ConfigurePackage plugin. test_configurepackage contains stub implementations

Index

Constants

View Source
const (
	// PackageNameHolder represents Place holder for package name
	PackageNameHolder = "{PackageName}"

	// ManifestNameFormat represents the manifest name format
	ManifestNameFormat = "{PackageName}.json"

	// PackageNameFormat represents the package name format based
	PackageNameFormat = "{PackageName}.{Compressed}"

	// PackageUrlStandard represents the s3 folder where all versions of a package live
	// the url to a specific package has a format like https://s3.us-east-1.amazonaws.com/amazon-ssm-packages-us-east-1/Packages/Test/windows/amd64/1.0.0/Test.zip
	PackageUrlStandard = "https://s3.{Region}.amazonaws.com/amazon-ssm-packages-{Region}/Packages/{PackageName}/{Platform}/{Arch}"

	// PackageUrlBeta is the s3 location for ad-hoc testing by package developers
	PackageUrlBeta = "https://s3.us-east-1.amazonaws.com/amazon-ssm-packages-beta/Packages/{PackageName}/{Platform}/{Arch}"

	// PackageUrlGamma is the s3 location for internal pre-production testing
	PackageUrlGamma = "https://s3.us-east-1.amazonaws.com/amazon-ssm-packages-us-east-1-gamma/Packages/{PackageName}/{Platform}/{Arch}"

	// PackageUrlBjs is the s3 location for BJS region where all packages live
	PackageUrlBjs = "https://s3.{Region}.amazonaws.com.cn/amazon-ssm-packages-{Region}/Packages/{PackageName}/{Platform}/{Arch}"

	// PackageNameSuffix represents (when concatenated with the correct package url) the s3 location of a specific version of a package
	PackageNameSuffix = "/{PackageVersion}/" + PackageNameFormat

	// InstallAction represents the json command to install package
	InstallAction = "Install"

	// UninstallAction represents the json command to uninstall package
	UninstallAction = "Uninstall"

	// PatternVersion represents the regular expression for validating version
	PatternVersion = "^(?:(\\d+)\\.)(?:(\\d+)\\.)(\\d+)$"
)

Variables

This section is empty.

Functions

func Name

func Name() string

Name returns the name of the plugin.

func NewUtil

func NewUtil(instanceContext *updateutil.InstanceContext, repository string) configureUtil

Types

type ConfigurePackagePluginInput

type ConfigurePackagePluginInput struct {
	contracts.PluginInput
	Name       string `json:"name"`
	Version    string `json:"version"`
	Action     string `json:"action"`
	Source     string `json:"source"`
	Repository string `json:"repository"`
}

ConfigurePackagePluginInput represents one set of commands executed by the ConfigurePackage plugin.

type ConfigurePackageStubs

type ConfigurePackageStubs struct {
	// contains filtered or unexported fields
}

func (*ConfigurePackageStubs) Clear

func (m *ConfigurePackageStubs) Clear()

Clear resets dependencies to their original values.

func (*ConfigurePackageStubs) Set

func (m *ConfigurePackageStubs) Set()

Set replaces dependencies with stub versions and saves the original version. it should always be followed by defer Clear()

type ExecDepStub

type ExecDepStub struct {
	// contains filtered or unexported fields
}

func (*ExecDepStub) ExeCommand

func (m *ExecDepStub) ExeCommand(log log.T, cmd string, workingDir string, updaterRoot string, stdOut string, stdErr string, isAsync bool) (err error)

func (*ExecDepStub) ExecuteDocument

func (m *ExecDepStub) ExecuteDocument(runner runpluginutil.PluginRunner, context context.T, pluginInput []model.PluginState, documentID string, documentCreatedDate string) (pluginOutputs map[string]*contracts.PluginResult)

func (*ExecDepStub) ParseDocument

func (m *ExecDepStub) ParseDocument(context context.T, documentRaw []byte, orchestrationDir string, s3Bucket string, s3KeyPrefix string, messageID string, documentID string, defaultWorkingDirectory string) (pluginsInfo []model.PluginState, err error)

type FileSysDepStub

type FileSysDepStub struct {
	// contains filtered or unexported fields
}

func (*FileSysDepStub) Exists

func (m *FileSysDepStub) Exists(filePath string) bool

func (*FileSysDepStub) GetDirectoryNames

func (m *FileSysDepStub) GetDirectoryNames(srcPath string) (directories []string, err error)

func (*FileSysDepStub) GetFileNames

func (m *FileSysDepStub) GetFileNames(srcPath string) (files []string, err error)

func (*FileSysDepStub) MakeDirExecute

func (m *FileSysDepStub) MakeDirExecute(destinationDir string) (err error)

func (*FileSysDepStub) ReadFile

func (m *FileSysDepStub) ReadFile(filename string) ([]byte, error)

func (*FileSysDepStub) RemoveAll

func (m *FileSysDepStub) RemoveAll(path string) error

func (*FileSysDepStub) Rename

func (m *FileSysDepStub) Rename(oldpath, newpath string) error

func (*FileSysDepStub) Uncompress

func (m *FileSysDepStub) Uncompress(src, dest string) error

func (*FileSysDepStub) WriteFile

func (m *FileSysDepStub) WriteFile(filename string, content string) error

type MockedConfigurePackageManager

type MockedConfigurePackageManager struct {
	mock.Mock
	// contains filtered or unexported fields
}

func ConfigPackageSuccessMock

func ConfigPackageSuccessMock(downloadFilePath string,
	versionToActOn string,
	versionCurrentlyInstalled string,
	packageManifest *PackageManifest,
	installResult contracts.ResultStatus,
	uninstallPreResult contracts.ResultStatus,
	uninstallPostResult contracts.ResultStatus) *MockedConfigurePackageManager

type NetworkDepStub

type NetworkDepStub struct {
	// contains filtered or unexported fields
}

func (*NetworkDepStub) Download

func (m *NetworkDepStub) Download(log log.T, input artifact.DownloadInput) (output artifact.DownloadOutput, err error)

func (*NetworkDepStub) ListS3Folders

func (m *NetworkDepStub) ListS3Folders(log log.T, amazonS3URL s3util.AmazonS3URL) (folderNames []string, err error)

type PackageManifest

type PackageManifest struct {
	Name         string `json:"name"`
	Platform     string `json:"platform"`
	Architecture string `json:"architecture"`
	Version      string `json:"version"`
}

PackageManifest represents json structure of package's online configuration file.

type Plugin

type Plugin struct {
	pluginutil.DefaultPlugin
}

Plugin is the type for the configurepackage plugin.

func NewPlugin

func NewPlugin(pluginConfig pluginutil.PluginConfig) (*Plugin, error)

NewPlugin returns a new instance of the plugin.

func (*Plugin) Execute

func (p *Plugin) Execute(context context.T, config contracts.Configuration, cancelFlag task.CancelFlag, subDocumentRunner runpluginutil.PluginRunner) (res contracts.PluginResult)

Execute runs multiple sets of commands and returns their outputs. res.Output will contain a slice of RunCommandPluginOutput.

Jump to

Keyboard shortcuts

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