Documentation
¶
Overview ¶
Package cloudsync provides helper functions for cloud sync operations.
Index ¶
- Constants
- func AfterRun(e *engine.Engine, run engine.StackCloudRun, state *CloudRunState, ...)
- func BeforeRun(e *engine.Engine, run engine.StackCloudRun, state *CloudRunState)
- func CreateCloudDeployment(e *engine.Engine, wd string, deployRuns []engine.StackCloudRun, ...) error
- func CreateCloudPreview(e *engine.Engine, gitfilter engine.GitFilter, runs []engine.StackCloudRun, ...) map[string]string
- func DetectCloudMetadata(e *engine.Engine, state *CloudRunState)
- func Logs(logger *zerolog.Logger, e *engine.Engine, run engine.StackRun, ...)
- type CloudRunState
- func (rs *CloudRunState) CloudDriftUUID(metaID string) (resources.UUID, bool)
- func (rs *CloudRunState) CloudPreviewID(metaID string) (string, bool)
- func (rs *CloudRunState) SetMeta2CloudID(metaID string, id int64)
- func (rs *CloudRunState) SetMeta2DriftUUID(metaID string, driftUUID resources.UUID)
- func (rs *CloudRunState) SetMeta2PreviewID(metaID string, previewID string)
- func (rs *CloudRunState) StackCloudID(metaID string) (int64, bool)
Constants ¶
const ( // ProvisionerTerraform indicates that a plan was created by Terraform. ProvisionerTerraform = "terraform" // ProvisionerOpenTofu indicates that a plan was created by OpenTofu. ProvisionerOpenTofu = "opentofu" )
Variables ¶
This section is empty.
Functions ¶
func AfterRun ¶
func AfterRun(e *engine.Engine, run engine.StackCloudRun, state *CloudRunState, res engine.RunResult, err error)
AfterRun is called after a cloud run.
func BeforeRun ¶
func BeforeRun(e *engine.Engine, run engine.StackCloudRun, state *CloudRunState)
BeforeRun is called before a cloud run.
func CreateCloudDeployment ¶
func CreateCloudDeployment(e *engine.Engine, wd string, deployRuns []engine.StackCloudRun, state *CloudRunState) error
CreateCloudDeployment creates a cloud deployment for the given runs.
func CreateCloudPreview ¶
func CreateCloudPreview(e *engine.Engine, gitfilter engine.GitFilter, runs []engine.StackCloudRun, target, fromTarget string, state *CloudRunState) map[string]string
CreateCloudPreview creates a cloud preview for the given runs.
func DetectCloudMetadata ¶
func DetectCloudMetadata(e *engine.Engine, state *CloudRunState)
DetectCloudMetadata detects the cloud metadata for the current run.
func Logs ¶
func Logs(logger *zerolog.Logger, e *engine.Engine, run engine.StackRun, task engine.StackRunTask, state *CloudRunState, logs resources.CommandLogs)
Logs synchronizes the logs of a command with the Terramate Cloud.
Types ¶
type CloudRunState ¶
type CloudRunState struct {
sync.RWMutex
RunUUID resources.UUID
ReviewRequest *resources.ReviewRequest
RREvent struct {
PushedAt *int64
CommitSHA string
}
Metadata *resources.DeploymentMetadata
// contains filtered or unexported fields
}
CloudRunState represents the state of the current run.
func (*CloudRunState) CloudDriftUUID ¶ added in v0.15.0
func (rs *CloudRunState) CloudDriftUUID(metaID string) (resources.UUID, bool)
CloudDriftUUID returns the cloud drift UUID of a stack given its metadata ID.
func (*CloudRunState) CloudPreviewID ¶
func (rs *CloudRunState) CloudPreviewID(metaID string) (string, bool)
CloudPreviewID returns the cloud preview ID of a stack given its metadata ID.
func (*CloudRunState) SetMeta2CloudID ¶
func (rs *CloudRunState) SetMeta2CloudID(metaID string, id int64)
SetMeta2CloudID sets the cloud ID of a stack given its metadata ID.
func (*CloudRunState) SetMeta2DriftUUID ¶ added in v0.15.0
func (rs *CloudRunState) SetMeta2DriftUUID(metaID string, driftUUID resources.UUID)
SetMeta2DriftUUID sets the cloud drift UUID of a stack given its metadata ID.
func (*CloudRunState) SetMeta2PreviewID ¶
func (rs *CloudRunState) SetMeta2PreviewID(metaID string, previewID string)
SetMeta2PreviewID sets the cloud preview ID of a stack given its metadata ID.
func (*CloudRunState) StackCloudID ¶
func (rs *CloudRunState) StackCloudID(metaID string) (int64, bool)
StackCloudID returns the cloud ID of a stack given its metadata ID.