deployer

package
v0.0.151 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CIInfo added in v0.0.116

type CIInfo struct {
	LogsURL string `json:"logsUrl"`
}

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.EnvLineComment
}

func (*EnvFile) Lookup

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

type GitInfo added in v0.0.72

type GitInfo struct {
	RemoteURL     *string `json:"remoteUrl"`
	Branch        *string `json:"branch"`
	Commit        *string `json:"commit"`
	CommitMessage *string `json:"commitMessage"`
	IsRepo        bool    `json:"isRepo"`
	GitProvider   *string `json:"gitProvider"`
}

GitInfo contains basic git repository information

func GetGitInfo added in v0.0.72

func GetGitInfo(logger logger.Logger, dir string) (*GitInfo, error)

GetGitInfo extracts git information from a directory

func GetGitInfoRecursive added in v0.0.116

func GetGitInfoRecursive(logger logger.Logger, startDir string) (*GitInfo, error)

GetGitInfoRecursive walks up directories until it finds a git repo and returns its info

type MachineInfo added in v0.0.72

type MachineInfo struct {
	OS       string `json:"os"`
	Arch     string `json:"arch"`
	Version  string `json:"version"`
	CPUs     int    `json:"cpus"`
	Hostname string `json:"hostname"`
	Username string `json:"username"`
}

func GetMachineInfo added in v0.0.72

func GetMachineInfo() *MachineInfo

type Metadata added in v0.0.72

type Metadata struct {
	Origin MetadataOrigin `json:"origin,omitempty"`
}

type MetadataOrigin added in v0.0.72

type MetadataOrigin struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

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, defaultValue string, placeholder string) string
}

Jump to

Keyboard shortcuts

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