deployer

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PreflightCheck

func PreflightCheck(ctx context.Context, logger logger.Logger, data DeployPreflightCheckData) error

Types

type DeployPreflightCheckData

type DeployPreflightCheckData struct {
	// Dir returns the full path to the project folder
	Dir string
	// APIClient is for communicating with the backend
	APIClient *util.APIClient
	// APIURL is the base url to the API
	APIURL string
	// APIKey is the projects api key
	APIKey string
	// Envfile if the project has a .env file and the parsed contents of that file
	Envfile *EnvFile
	// Project is the project data
	Project *project.Project
	// ProjectData is the project data loaded from the backend
	ProjectData *project.ProjectData
	// Config is the deployment configuration
	Config *project.DeploymentConfig
	// PromptHelpers are a set of funcs to assist in prompting the user on the command line
	PromptHelpers PromptHelpers
	// OS Environment as a map
	OSEnvironment map[string]string
}

type EnvFile

type EnvFile struct {
	Filepath string
	Env      []env.EnvLine
}

func (*EnvFile) Lookup

func (e *EnvFile) Lookup(key string) (string, bool)

type PromptHelpers

type PromptHelpers struct {
	// ShowSpinner will show a spinner with the title while the action is running
	ShowSpinner func(title string, action func())
	// PrintSuccess will print a check mark and the message provided with optional formatting arguments
	PrintSuccess func(msg string, args ...any)
	// PrintLock will print a lock and the message provided with optional formatting arguments
	PrintLock func(msg string, args ...any)
	// PrintLock will print an X mark and the message provided with optional formatting arguments
	PrintWarning func(msg string, args ...any)
	// CommandString will format a CLI command
	CommandString func(cmd string, args ...string) string
	// LinkString will return a formatted URL string
	LinkString func(cmd string, args ...any) string
	// Ask will ask the user for input and return true (confirm) or false (no!)
	Ask func(logger logger.Logger, title string, defaultValue bool) bool
	// PromptForEnv is a helper for prompting the user to get a environment (or secret) value. You must do something with the result such as save it.
	PromptForEnv func(logger logger.Logger, key string, isSecret bool, localenv map[string]string, osenv map[string]string) string
}

Jump to

Keyboard shortcuts

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