Package engine provides the core functionality of Terramate.
const ( ErrCurrentHeadIsOutOfDate errors.Kind = "current HEAD is out-of-date with the remote base branch" )
This section is empty.
IsDeploymentTask returns true if the task is a deployment task.
IsDriftTask returns true if the task is a drift task.
IsPreviewTask returns true if the task is a preview task.
ParseFilterTags parses the tags and notags arguments.
CloudOrgState represents the state of a cloud organization.
CloudState represents the state of the cloud.
Engine holds the Terramate runtime state and does the heavy lifting of the CLI. The engine exposes an API for the core machinery of Terramate (stack management, change detection, stack ordering, etc) and is used by the CLI commands. Note(i4k): It's stateful and shared between commands, so beware of the side-effects of calling its methods. This is not the ideal design but the result of refactoring the cli package into per-package commands.
Load loads the engine with the given working directory and CLI configuration. If the project is not found, it returns false.
BaseRef returns the git baseref of the project.
CLIConfig returns the CLI configuration.
CheckTargetsConfiguration checks the target configuration of the project.
CloudClient returns the cloud client.
CloudOrgName returns the name of the cloud organization.
CloudRegion returns the cloud region from configuration, defaulting to EU.
CloudState returns the cloud state.
ComputeSelectedStacks computes stacks based on filters, working directory, tags, filesystem ordering, git changes, etc.
Config returns the root configuration of the project.
Credential returns the cloud credential.
DetectEvalContext detects the evaluation context for a stack.
DisableCloudFeatures disables cloud features and prints an error message.
EnsureAllStackHaveIDs ensures all stacks have IDs.
FilterStacks filters stacks based on tags and working directory.
FilterStacksByBasePath filters out stacks not inside the given base path.
FriendlyFmtDir formats the directory path in a friendly way.
GetAffectedStacks returns the list of stacks affected by the current command. c.affectedStacks is expected to be already set, if not it will be computed and cached.
HCLOptions returns the HCL options used to load the configuration.
IsCloudDisabled returns true if cloud features are disabled.
IsCloudEnabled returns true if cloud features are enabled.
ListStacks returns the list of stacks based on filters.
LoadCredential loads the cloud credential from the environment or configuration.
Project returns the project.
ReloadConfig reloads the root configuration of the project.
RepoChecks returns the cached repository checks.
RootNode returns the root node of the project.
RunAll will execute the list of RunStack definitions. A RunStack defines the stack and its command to be executed. The isSuccessCode is a predicate used to decide if the command is considered a successful run or not. During the execution of this function the default behavior for signal handling will be changed so we can wait for the child process to exit before exiting Terramate. If a single SIGINT is sent to the Terramate process group then Terramate will wait for the process graceful exit and abort the execution of all subsequent stacks. If SIGINT is sent 3x then Terramate will send a SIGKILL to the currently running process and abort the execution of all subsequent stacks.
SetupCloudConfig sets up the cloud configuration.
SetupEvalContext sets up the evaluation context for a stack.
StackManager returns the stack manager.
VendorDir returns the vendor directory path.
type GitFilter struct { IsChanged bool ChangeBase string EnableUntracked *bool EnableUncommitted *bool }
GitFilter holds the configuration for git change detection.
NewGitFilter creates a new GitFilter.
NoGitFilter returns a GitFilter for unfiltered list.
Hooks contains hooks that can be used to extend the behavior of the run engine.
LogSyncCondition is a function that is used to determine if the log syncer should be enabled for a given task.
LogSyncer is a function that is called when the cloud API is enabled and the log sync condition is met.
type OutputsSharingOptions struct { IncludeOutputDependencies bool OnlyOutputDependencies bool }
OutputsSharingOptions holds the configuration for sharing outputs between stacks.
type Project struct { Git struct { Wrapper *git.Git RemoteConfigured bool BranchConfigured bool } }
Project represents a Terramate project.
NewProject creates a new project from the working directory.
CIPlatform returns the CI platform of the project.
DefaultBaseRef returns the baseRef for the current git environment.
DefaultBranchRef returns the default branch ref. Usually it's "origin/main".
DefaultLocalBaseRef returns the baseRef in case there's no remote setup.
GitConfig returns the git configuration of the project.
HasCommit returns true if the project has a commit.
HasCommits returns true if the project has commits.
HeadCommit returns the HEAD commit of the project.
IsGitFeaturesEnabled returns true if the project has git features enabled.
IsRepo returns true if the project is a git repository.
LocalDefaultBranchCommit returns the local default branch commit of the project.
PrettyRepo returns the pretty repository name.
RemoteDefaultCommit returns the remote default branch commit of the project. Eg.: git fetch origin main && git rev-parse origin/main
Repo returns the git repository of the project.
RunAfterHook is a function that is called after a stack is executed by the run engine.
RunAllOptions contains options for the RunAll method.
RunBeforeHook is a function that is called before a stack is executed by the run engine.
RunResult contains exit code and duration of a completed run.
StackCloudRun is a stackRun, but with a single task, because the cloud API only supports a single command per stack for any operation (deploy, drift, preview).
SelectCloudStackTasks selects cloud tasks from a list of stack runs.
StackRun contains a list of tasks to be run per stack.
StackRunTask defines the command to be run and the cloud options.
UIMode defines different modes of operation for the cli.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4