Documentation ¶
Index ¶
- Constants
- type Action
- type BuildInput
- type GroupCommand
- func (c *GroupCommand) GetArguments() []string
- func (c *GroupCommand) GetCommand() string
- func (c *GroupCommand) GetFlags() builder.Flags
- func (c *GroupCommand) GetWorkingDir() string
- func (c *GroupCommand) HandleError(ctx context.Context, err builder.ExitError, stdout string, stderr string) error
- func (c *GroupCommand) SetAction(action string)
- func (c *GroupCommand) SuppressesOutput() bool
- type Mixin
- func (m *Mixin) Build(ctx context.Context) error
- func (m *Mixin) Execute(ctx context.Context) error
- func (m *Mixin) GetMixinUserAgent() string
- func (m *Mixin) PrintSchema() error
- func (m *Mixin) PrintVersion(opts version.Options) error
- func (m *Mixin) SetUserAgent()
- func (m *Mixin) Version() mixin.Metadata
- type MixinConfig
- type Output
- type Steps
- type TestMixin
- type TypedCommand
- type TypedStep
- type UserCommand
- func (s *UserCommand) GetArguments() []string
- func (s *UserCommand) GetCommand() string
- func (s *UserCommand) GetFlags() builder.Flags
- func (s *UserCommand) GetOutputs() []builder.Output
- func (s UserCommand) GetWorkingDir() string
- func (s *UserCommand) SetAction(_ string)
- func (s *UserCommand) SuppressesOutput() bool
Constants ¶
const ( // AzureUserAgentEnvVar is the environment variable used by the az CLI to set // the user agent string sent to Azure. AzureUserAgentEnvVar = "AZURE_HTTP_USER_AGENT" // UserAgentOptOutEnvVar is the name of the environment variable that disables // user agent reporting. UserAgentOptOutEnvVar = "PORTER_AZ_MIXIN_USER_AGENT_OPT_OUT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Name string Steps []TypedStep // using UnmarshalYAML so that we don't need a custom type per action }
func (Action) GetSteps ¶
func (a Action) GetSteps() []builder.ExecutableStep
func (Action) MakeSteps ¶
func (a Action) MakeSteps() interface{}
MakeSteps builds a slice of Steps for data to be unmarshaled into.
func (*Action) UnmarshalYAML ¶
UnmarshalYAML takes any yaml in this form ACTION: - az: ... and puts the steps into the Action.Steps field
type BuildInput ¶
type BuildInput struct {
Config MixinConfig
}
BuildInput represents stdin passed to the mixin for the build command.
type GroupCommand ¶ added in v0.6.0
type GroupCommand struct { Description string `yaml:"description"` Name string `yaml:"name"` Location string `yaml:"location"` // contains filtered or unexported fields }
GroupCommand ensures that a group exist or not
func (*GroupCommand) GetArguments ¶ added in v0.6.0
func (c *GroupCommand) GetArguments() []string
func (*GroupCommand) GetCommand ¶ added in v0.6.0
func (c *GroupCommand) GetCommand() string
func (*GroupCommand) GetFlags ¶ added in v0.6.0
func (c *GroupCommand) GetFlags() builder.Flags
func (*GroupCommand) GetWorkingDir ¶ added in v0.6.0
func (c *GroupCommand) GetWorkingDir() string
func (*GroupCommand) HandleError ¶ added in v0.6.0
func (*GroupCommand) SetAction ¶ added in v0.6.0
func (c *GroupCommand) SetAction(action string)
func (*GroupCommand) SuppressesOutput ¶ added in v0.6.0
func (c *GroupCommand) SuppressesOutput() bool
type Mixin ¶
type Mixin struct { runtime.RuntimeConfig // contains filtered or unexported fields }
func NewFor ¶ added in v1.0.0
func NewFor(cfg runtime.RuntimeConfig) *Mixin
func (*Mixin) GetMixinUserAgent ¶ added in v1.0.0
GetMixinUserAgent returns the portion of the user agent string for the mixin.
func (*Mixin) PrintSchema ¶
func (*Mixin) SetUserAgent ¶ added in v0.7.0
func (m *Mixin) SetUserAgent()
SetUserAgent sets the AZURE_HTTP_USER_AGENT environment variable with the full user agent string, which includes both a portion for porter and the mixin.
type MixinConfig ¶
type MixinConfig struct { // UserAgentOptOut allows a bundle author to opt out from adding porter and the mixin's version to the az CLI user agent string. UserAgentOptOut bool `yaml:"userAgentOptOut,omitempty"` // ClientVersion is the version of the az CLI to install. ClientVersion string `yaml:"clientVersion,omitempty"` // Extensions is a list of az CLI extensions to install. Extensions []string `yaml:"extensions,omitempty"` }
MixinConfig represents configuration that can be set on the az mixin in porter.yaml mixins:
- az: extensions:
- NAME
type Output ¶
type Output struct { Name string `yaml:"name"` // See https://porter.sh/mixins/exec/#outputs JsonPath string `yaml:"jsonPath,omitempty"` FilePath string `yaml:"path,omitempty"` }
func (Output) GetFilePath ¶
func (Output) GetJsonPath ¶
type TestMixin ¶
type TestMixin struct { *Mixin TestContext *portercontext.TestContext }
func NewTestMixin ¶
NewTestMixin initializes a mixin test client, with the output buffered, and an in-memory file system.
type TypedCommand ¶ added in v0.6.0
type TypedCommand interface { SetAction(action string) builder.ExecutableStep builder.SuppressesOutput }
type TypedStep ¶ added in v0.6.0
type TypedStep struct { Description string TypedCommand }
func (*TypedStep) UnmarshalYAML ¶ added in v0.6.0
UnmarshalYAML takes any yaml in this form az:
description: something COMMAND: # custom... -> make the CustomCommand for us
type UserCommand ¶ added in v0.6.0
type UserCommand struct { Name string `yaml:"name"` Description string `yaml:"description"` Arguments []string `yaml:"arguments,omitempty"` Flags builder.Flags `yaml:"flags,omitempty"` Outputs []Output `yaml:"outputs,omitempty"` SuppressOutput bool `yaml:"suppress-output,omitempty"` // Support custom error handling builder.IgnoreErrorHandler `yaml:"ignoreErrors,omitempty"` }
func (*UserCommand) GetArguments ¶ added in v0.6.0
func (s *UserCommand) GetArguments() []string
func (*UserCommand) GetCommand ¶ added in v0.6.0
func (s *UserCommand) GetCommand() string
func (*UserCommand) GetFlags ¶ added in v0.6.0
func (s *UserCommand) GetFlags() builder.Flags
func (*UserCommand) GetOutputs ¶ added in v0.6.0
func (s *UserCommand) GetOutputs() []builder.Output
func (UserCommand) GetWorkingDir ¶ added in v0.6.0
func (s UserCommand) GetWorkingDir() string
func (*UserCommand) SetAction ¶ added in v0.6.0
func (s *UserCommand) SetAction(_ string)
func (*UserCommand) SuppressesOutput ¶ added in v0.6.0
func (s *UserCommand) SuppressesOutput() bool