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
- func Name() string
- func NewUtil(instanceContext *updateutil.InstanceContext, repository string) configureUtil
- type ConfigurePackagePluginInput
- type ConfigurePackageStubs
- type ExecDepStub
- func (m *ExecDepStub) ExeCommand(log log.T, cmd string, workingDir string, updaterRoot string, stdOut string, ...) (err error)
- func (m *ExecDepStub) ExecuteDocument(runner runpluginutil.PluginRunner, context context.T, ...) (pluginOutputs map[string]*contracts.PluginResult)
- func (m *ExecDepStub) ParseDocument(context context.T, documentRaw []byte, orchestrationDir string, ...) (pluginsInfo []model.PluginState, err error)
- type FileSysDepStub
- func (m *FileSysDepStub) Exists(filePath string) bool
- func (m *FileSysDepStub) GetDirectoryNames(srcPath string) (directories []string, err error)
- func (m *FileSysDepStub) GetFileNames(srcPath string) (files []string, err error)
- func (m *FileSysDepStub) MakeDirExecute(destinationDir string) (err error)
- func (m *FileSysDepStub) ReadFile(filename string) ([]byte, error)
- func (m *FileSysDepStub) RemoveAll(path string) error
- func (m *FileSysDepStub) Rename(oldpath, newpath string) error
- func (m *FileSysDepStub) Uncompress(src, dest string) error
- func (m *FileSysDepStub) WriteFile(filename string, content string) error
- type MockedConfigurePackageManager
- type NetworkDepStub
- type PackageManifest
- type Plugin
Constants ¶
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 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 (*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 ¶
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
type MockedConfigurePackageManager ¶
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.