Documentation ¶
Index ¶
- Constants
- func IsCoreAction(value Action) bool
- type Action
- type BundleConnection
- type BundleOutput
- type Config
- func (c *Config) GetBundlesCache() (string, error)
- func (c *Config) GetCredentialPath(name string) (string, error)
- func (c *Config) GetCredentialsDir() (string, error)
- func (c *Config) GetHomeDir() (string, error)
- func (c *Config) GetMixinDir(mixin string) (string, error)
- func (c *Config) GetMixinPath(mixin string) (string, error)
- func (c *Config) GetMixinRuntimePath(mixin string) (string, error)
- func (c *Config) GetMixinsDir() (string, error)
- func (c *Config) GetOutputsDir() (string, error)
- func (c *Config) GetPorterPath() (string, error)
- func (c *Config) GetPorterRuntimePath() (string, error)
- func (c *Config) LoadManifest() error
- func (c *Config) LoadManifestFrom(file string) error
- func (c *Config) ReadManifest(path string) (*Manifest, error)
- func (c *Config) SetHomeDir(home string)
- type CredentialDefinition
- type CustomActionDefinition
- type Dependency
- type Location
- type Manifest
- func (m *Manifest) ApplyStepOutputs(step *Step, assignments map[string]string) error
- func (m *Manifest) GetManifestDir() string
- func (m *Manifest) GetManifestPath() string
- func (m *Manifest) GetSensitiveValues() []string
- func (m *Manifest) GetSteps(action Action) (Steps, error)
- func (m *Manifest) ResolveStep(step *Step) error
- func (m *Manifest) Validate() error
- type MappedImage
- type OutputDefinition
- type ParameterDefinition
- type Schema
- type Step
- type StepOutput
- type Steps
- type TestConfig
Constants ¶
const ( // Name is the file name of the porter configuration file. Name = "porter.yaml" // EnvHOME is the name of the environment variable containing the porter home directory path. EnvHOME = "PORTER_HOME" // EnvBundleName is the name of the environment variable containing the name of the bundle. EnvBundleName = "CNAB_BUNDLE_NAME" // EnvClaimName is the name of the environment variable containing the name of the claim. EnvClaimName = "CNAB_INSTALLATION_NAME" // EnvACTION is the request EnvACTION = "CNAB_ACTION" // EnvDEBUG is a custom porter parameter that signals that --debug flag has been passed through from the client to the runtime. EnvDEBUG = "PORTER_DEBUG" CustomBundleKey = "sh.porter" // BundleOutputsDir is the directory where outputs are expected to be placed // during the execution of a bundle action. BundleOutputsDir = "/cnab/app/outputs" )
Variables ¶
This section is empty.
Functions ¶
func IsCoreAction ¶
IsCoreAction determines if the value is a core action from the CNAB spec.
Types ¶
type BundleConnection ¶
type BundleOutput ¶
type Config ¶
type Config struct { *context.Context Manifest *Manifest // contains filtered or unexported fields }
func (*Config) GetBundlesCache ¶
GetBundlesDir locates the bundle cache from the porter home directory.
func (*Config) GetCredentialsDir ¶
func (*Config) GetHomeDir ¶
GetHomeDir determines the absolute path to the porter home directory.
func (*Config) GetMixinRuntimePath ¶
func (*Config) GetMixinsDir ¶
func (*Config) GetOutputsDir ¶
func (*Config) GetPorterPath ¶
func (*Config) GetPorterRuntimePath ¶
func (*Config) LoadManifest ¶
func (*Config) LoadManifestFrom ¶
func (*Config) ReadManifest ¶
ReadManifest determines if specified path is a URL or a filepath. After reading the data in the path it returns a Manifest and any errors
func (*Config) SetHomeDir ¶
type CredentialDefinition ¶
type CustomActionDefinition ¶
type Dependency ¶
type Dependency struct { Tag string `yaml:"tag"` Versions []string `yaml:"versions"` AllowPrereleases bool `yaml:"prereleases"` Parameters map[string]string `yaml:"parameters,omitempty"` }
func (*Dependency) Validate ¶
func (d *Dependency) Validate() error
type Manifest ¶
type Manifest struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Version string `yaml:"version,omitempty"` // Image is the name of the invocation image in the format REGISTRY/NAME:TAG Image string `yaml:"invocationImage,omitempty"` // BundleTag is the name of the bundle in the format REGISTRY/NAME:TAG BundleTag string `yaml:"tag"` // Dockerfile is the relative path to the Dockerfile template for the invocation image Dockerfile string `yaml:"dockerfile,omitempty"` Mixins []string `yaml:"mixins,omitempty"` Install Steps `yaml:"install"` Uninstall Steps `yaml:"uninstall"` Upgrade Steps `yaml:"upgrade"` CustomActions map[string]Steps `yaml:"-"` CustomActionDefinitions map[string]CustomActionDefinition `yaml:"customActions,omitempty"` Parameters []ParameterDefinition `yaml:"parameters,omitempty"` Credentials []CredentialDefinition `yaml:"credentials,omitempty"` Dependencies map[string]Dependency `yaml:"dependencies,omitempty"` Outputs []OutputDefinition `yaml:"outputs,omitempty"` // ImageMap is a map of images referenced in the bundle. The mappings are mounted as a file at runtime to // /cnab/app/image-map.json. This data is not used by porter or any of the deislabs mixins, so only populate when you // plan on manually using this data in your own scripts. ImageMap map[string]MappedImage `yaml:"imageMap,omitempty"` // contains filtered or unexported fields }
func UnmarshalManifest ¶
func (*Manifest) ApplyStepOutputs ¶
func (*Manifest) GetManifestDir ¶
GetManifestDir returns the path to the directory that contains the manifest.
func (*Manifest) GetManifestPath ¶
GetManifestPath returns the path where the manifest was loaded. May be a URL.
func (*Manifest) GetSensitiveValues ¶
func (*Manifest) ResolveStep ¶
ResolveStep will walk through the Step's data and resolve any placeholder data using the definitions in the manifest, like parameters or credentials.
type MappedImage ¶
type MappedImage struct { Description string `yaml:"description"` ImageType string `yaml:"imageType"` Image string `yaml:"image"` OriginalImage string `yaml:"originalImage,omitempty"` Digest string `yaml:"digest,omitempty"` Size uint64 `yaml:"size,omitempty"` MediaType string `yaml:"mediaType,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` }
type OutputDefinition ¶
type OutputDefinition struct { Name string `yaml:"name"` ApplyTo []string `yaml:"applyTo,omitempty"` Description string `yaml:"description,omitempty"` Sensitive bool `yaml:"sensitive"` Schema `yaml:",inline"` }
OutputDefinition defines a single output for a CNAB
func (*OutputDefinition) Validate ¶
func (od *OutputDefinition) Validate() error
type ParameterDefinition ¶
type ParameterDefinition struct { Name string `yaml:"name"` Sensitive bool `yaml:"sensitive"` // These could be swapped out with an inline bundle.ParameterDefinition // from cnab-go, e.g. bundle.ParameterDefinition `yaml:",inline"` Description string `yaml:"description,omitempty"` Destination *Location `yaml:"destination,omitempty"` ApplyTo []string `yaml:"applyTo,omitempty"` Schema `yaml:",inline"` }
ParameterDefinition defines a single parameter for a CNAB bundle
type Schema ¶
type Schema struct { Type string `yaml:"type"` Default interface{} `yaml:"default,omitempty"` Enum []interface{} `yaml:"enum,omitempty"` Required bool `yaml:"required"` Minimum *float64 `yaml:"minimum,omitempty"` ExclusiveMinimum *float64 `yaml:"exclusiveMinimum,omitempty"` Maximum *float64 `yaml:"maximum,omitempty"` ExclusiveMaximum *float64 `yaml:"exclusiveMaximum,omitempty"` MinLength *float64 `yaml:"minLength,omitempty"` MaxLength *float64 `yaml:"maxLength,omitempty"` }
type Step ¶
type Step struct {
Data map[string]interface{} `yaml:",inline"`
}
func (*Step) GetDescription ¶
GetDescription returns a description of the step. Every step must have this property.
func (*Step) GetMixinName ¶
type StepOutput ¶
type TestConfig ¶
type TestConfig struct { *Config TestContext *context.TestContext }
func NewTestConfig ¶
func NewTestConfig(t *testing.T) *TestConfig
NewTestConfig initializes a configuration suitable for testing, with the output buffered, and an in-memory file system.
func (*TestConfig) SetupIntegrationTest ¶
func (c *TestConfig) SetupIntegrationTest(home string)
InitializePorterHome initializes the filesystem with the supporting files in the PORTER_HOME directory.
func (*TestConfig) SetupPorterHome ¶
func (c *TestConfig) SetupPorterHome()
InitializePorterHome initializes the test filesystem with the supporting files in the PORTER_HOME directory.