cloudsync

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2025 License: MPL-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package cloudsync provides helper functions for cloud sync operations.

Index

Constants

View Source
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, state *CloudRunState, logs resources.CommandLogs)

Logs synchronizes the logs of a command with the Terramate Cloud.

Types

type CloudRunState

type CloudRunState struct {
	RunUUID resources.UUID

	StackMeta2ID map[string]int64
	// stackPreviews is a map of stack.ID to stackPreview.ID
	StackMeta2PreviewIDs map[string]string
	ReviewRequest        *resources.ReviewRequest
	RREvent              struct {
		PushedAt  *int64
		CommitSHA string
	}
	Metadata *resources.DeploymentMetadata
}

CloudRunState represents the state of the current run.

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) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL