Files
atlantis/server/core/runtime/executor.go
Ken Kaizu 27b9897517 chore(build): rm pegomock experimental feature for smooth mock generation (#2886)
* disable pegomock --use-experimental-model-gen, cause random fail by segv

* make regen-mocks

* fix mock code which uses non experimental pegomock codes
2022-12-27 19:58:15 -06:00

26 lines
950 B
Go

package runtime
import (
version "github.com/hashicorp/go-version"
"github.com/runatlantis/atlantis/server/events/command"
"github.com/runatlantis/atlantis/server/logging"
)
//go:generate pegomock generate -m --package mocks -o mocks/mock_versionedexecutorworkflow.go VersionedExecutorWorkflow
// VersionedExecutorWorkflow defines a versioned execution for a given project context
type VersionedExecutorWorkflow interface {
ExecutorVersionEnsurer
Executor
}
// Executor runs an executable with provided environment variables and arguments and returns stdout
type Executor interface {
Run(ctx command.ProjectContext, executablePath string, envs map[string]string, workdir string, extraArgs []string) (string, error)
}
// ExecutorVersionEnsurer ensures a given version exists and outputs a path to the executable
type ExecutorVersionEnsurer interface {
EnsureExecutorVersion(log logging.SimpleLogging, v *version.Version) (string, error)
}