Documentation ¶
Overview ¶
Package runtime holds code for actually running commands vs. preparing and constructing.
Index ¶
- func GetPlanFilename(workspace string, projName string) string
- func MustConstraint(constraint string) version.Constraints
- func ProjectNameFromPlanfile(workspace string, filename string) (string, error)
- type ApplyStepRunner
- type AsyncTFExec
- type EnvStepRunner
- type InitStepRunner
- type PlanStepRunner
- type PullApprovedChecker
- type RunStepRunner
- type StatusUpdater
- type TerraformExec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPlanFilename ¶ added in v0.4.1
GetPlanFilename returns the filename (not the path) of the generated tf plan given a workspace and project name.
func MustConstraint ¶
func MustConstraint(constraint string) version.Constraints
MustConstraint returns a constraint. It panics on error.
func ProjectNameFromPlanfile ¶ added in v0.7.0
ProjectNameFromPlanfile returns the project name that a planfile with name filename is for. If filename is for a project without a name then it will return an empty string. workspace is the workspace this project is in.
Types ¶
type ApplyStepRunner ¶
type ApplyStepRunner struct { TerraformExecutor TerraformExec CommitStatusUpdater StatusUpdater AsyncTFExec AsyncTFExec }
ApplyStepRunner runs `terraform apply`.
type AsyncTFExec ¶ added in v0.5.0
type AsyncTFExec interface { // RunCommandAsync runs terraform with args. It immediately returns an // input and output channel. Callers can use the output channel to // get the realtime output from the command. // Callers can use the input channel to pass stdin input to the command. // If any error is passed on the out channel, there will be no // further output (so callers are free to exit). RunCommandAsync(log *logging.SimpleLogger, path string, args []string, envs map[string]string, v *version.Version, workspace string) (chan<- string, <-chan terraform.Line) }
AsyncTFExec brings the interface from TerraformClient into this package without causing circular imports. It's split from TerraformExec because due to a bug in pegomock with channels, we can't generate a mock for it so we hand-write it for this specific method.
type EnvStepRunner ¶ added in v0.9.0
type EnvStepRunner struct {
RunStepRunner *RunStepRunner
}
EnvStepRunner set environment variables.
func (*EnvStepRunner) Run ¶ added in v0.9.0
func (r *EnvStepRunner) Run(ctx models.ProjectCommandContext, command string, value string, path string, envs map[string]string) (string, error)
Run runs the env step command. value is the value for the environment variable. If set this is returned as the value. Otherwise command is run and its output is the value returned.
type InitStepRunner ¶
type InitStepRunner struct { TerraformExecutor TerraformExec DefaultTFVersion *version.Version }
InitStep runs `terraform init`.
type PlanStepRunner ¶
type PlanStepRunner struct { TerraformExecutor TerraformExec DefaultTFVersion *version.Version CommitStatusUpdater StatusUpdater AsyncTFExec AsyncTFExec }
type PullApprovedChecker ¶
type RunStepRunner ¶
type RunStepRunner struct { TerraformExecutor TerraformExec DefaultTFVersion *version.Version // TerraformBinDir is the directory where Atlantis downloads Terraform binaries. TerraformBinDir string }
RunStepRunner runs custom commands.
type StatusUpdater ¶ added in v0.5.0
type StatusUpdater interface {
UpdateProject(ctx models.ProjectCommandContext, cmdName models.CommandName, status models.CommitStatus, url string) error
}
StatusUpdater brings the interface from CommitStatusUpdater into this package without causing circular imports.
type TerraformExec ¶
type TerraformExec interface { RunCommandWithVersion(log *logging.SimpleLogger, path string, args []string, envs map[string]string, v *version.Version, workspace string) (string, error) EnsureVersion(log *logging.SimpleLogger, v *version.Version) error }
TerraformExec brings the interface from TerraformClient into this package without causing circular imports.