Files
atlantis/server/events/runtime/executor.go
Nish Krishnan 7ac8106f8a Add structured logger (#54) (#1467)
This is two changes:

Replacing all usages of SimpleLogger with it's interface SimpleLogging which makes it easier to swap out loggers going forward
Nukes SimpleLogger in favor of StructuredLogger which allows us to better analyze logs in our log management system we choose.
2021-04-06 12:02:25 -07:00

26 lines
964 B
Go

package runtime
import (
version "github.com/hashicorp/go-version"
"github.com/runatlantis/atlantis/server/events/models"
"github.com/runatlantis/atlantis/server/logging"
)
//go:generate pegomock generate -m --use-experimental-model-gen --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 models.ProjectCommandContext, executablePath string, envs map[string]string, workdir 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)
}