deploy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupServices

func BackupServices(client *goss.Client, destDir string) (string, error)

func BuildAndPushImage

func BuildAndPushImage(dir, name string, reg RegistryConfig) (string, error)

BuildAndPushImage builds a Go binary locally, wraps in minimal Docker image, pushes to registry

func GenerateCompose

func GenerateCompose(imageRef, serviceName string, port int, hasDB bool) []byte

GenerateCompose generates a docker-compose.yml with optional postgres sidecar

func GetCertInfo

func GetCertInfo(client *goss.Client, domain string) (string, error)

func HealthCheck

func HealthCheck(client *goss.Client, name string, timeout int) error

func InstallAlertRule

func InstallAlertRule(client *goss.Client, ruleFilePath string) error

func InstallAlertmanager

func InstallAlertmanager(client *goss.Client, cfg AlertmanagerConfig) error

func InstallCaddy

func InstallCaddy(client *goss.Client, cfg CaddyConfig) error

func InstallPromtail

func InstallPromtail(client *goss.Client, cfg PromtailConfig) error

func ListServices

func ListServices(client *goss.Client) ([]string, error)

func ListVersions

func ListVersions(client *goss.Client, serviceName string) ([]string, error)

func RestoreServices

func RestoreServices(client *goss.Client, backupPath string) error

func Rollback

func Rollback(client *goss.Client, serviceName string) error

func RunService

func RunService(client *goss.Client, cfg ServiceConfig) error

func ServiceLogs

func ServiceLogs(client *goss.Client, name string, tail int, follow bool) error

func ServiceStatus

func ServiceStatus(client *goss.Client, name string) (string, error)

func UninstallAlertmanager

func UninstallAlertmanager(client *goss.Client) error

func UninstallCaddy

func UninstallCaddy(client *goss.Client) error

func UninstallPromtail

func UninstallPromtail(client *goss.Client) error

func UploadImage

func UploadImage(client *goss.Client, serviceName, version string, imageTar []byte) (string, error)

UploadImage uploads a Docker image tar.gz to the VPS and loads it

Types

type AlertmanagerConfig

type AlertmanagerConfig struct {
	SlackWebhookURL string
	Email           string
	TelegramToken   string
	TelegramChatID  string
}

func (AlertmanagerConfig) HasReceiver

func (c AlertmanagerConfig) HasReceiver() bool

type CaddyConfig

type CaddyConfig struct {
	Domain     string
	Email      string
	TargetPort int
	Staging    bool
}

type DeployResult

type DeployResult struct {
	Version     string
	ServicePath string
}

func UploadAndDeploy

func UploadAndDeploy(client *goss.Client, cfg UploadConfig) (*DeployResult, error)

type PromtailConfig

type PromtailConfig struct {
	LokiURL  string
	NodeName string
	Port     int
}

type RegistryConfig

type RegistryConfig struct {
	Server   string
	Username string
	Password string
}

func DefaultRegistry

func DefaultRegistry() RegistryConfig

type ServiceConfig

type ServiceConfig struct {
	Name      string
	Type      string // docker, k3s, systemd
	Image     string // Docker image (for docker type)
	Port      int
	Replicas  int
	EnvFile   string
	HealthURL string
}

type UploadConfig

type UploadConfig struct {
	ServiceName string
	SourceDir   string   // Local directory to upload
	Files       []string // Specific files to include (empty = all)
	Exclude     []string // Patterns to exclude
}

Jump to

Keyboard shortcuts

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