deploy

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExcludePatterns = []string{
	".git/",
	"data/",
	"*.db",
	"*.db-shm",
	"*.db-wal",
	".cursor/",
	".env",
	"dq.env",
}

DefaultExcludePatterns mirror the historical rsync/SFTP exclude list (readme §4.3).

Functions

func ArtifactsUseSaveLoad

func ArtifactsUseSaveLoad(cfg *config.Config) bool

ArtifactsUseSaveLoad matches the former bash deploy script’s registry vs save/load rules.

func DeployBuildRemote added in v1.1.1

func DeployBuildRemote(cfg *config.Config, opts RunOpts) bool

DeployBuildRemote is true when deploy_build_remote is set and a build is requested (same condition as runArtifactBuilds: deploy_push or CLI --build).

func EffectiveDeployPush

func EffectiveDeployPush(cfg *config.Config) bool

EffectiveDeployPush is true when deploy_push is explicitly true.

func EffectiveSaveCompress

func EffectiveSaveCompress(cfg *config.Config) bool

EffectiveSaveCompress defaults to true when unset (bash DEPLOY_SAVE_COMPRESS default 1).

func MergeExcludePatterns

func MergeExcludePatterns(cfg *config.Config) []string

MergeExcludePatterns returns defaults plus cfg.Exclude (YAML / merged config).

func MirrorProjectTree

func MirrorProjectTree(c *sftp.Client, localRoot, remoteRoot string, patterns []string) error

MirrorProjectTree uploads the project tree to remoteRoot via SFTP, mirroring rsync --delete semantics using size + mtime comparison (readme §4.3). Excluded paths are not sent; extra remote files are removed.

func ModeIsArtifacts

func ModeIsArtifacts(cfg *config.Config) bool

ModeIsArtifacts reports deploy_mode == artifacts (case-insensitive).

func PathExcluded

func PathExcluded(rel string, patterns []string) bool

PathExcluded reports whether rel (slash-separated, relative to project root, no leading "./") matches any pattern.

func RemoteConfigCheckScript

func RemoteConfigCheckScript(cfg *config.Config, remoteRoot string) string

RemoteConfigCheckScript returns a bash fragment: no-op if app_config unset, else test -f.

func RemoteRelAppConfig

func RemoteRelAppConfig(cfg *config.Config) string

RemoteRelAppConfig is the path of the app config file relative to remote_path (for test -f on the server).

func Run

func Run(projectRoot string, cfg *config.Config) error

Run runs deploy in source or artifacts mode per cfg.DeployMode.

func RunArtifacts

func RunArtifacts(projectRoot string, cfg *config.Config, opts RunOpts) error

RunArtifacts builds/pushes or save-loads the image(s), syncs compose + config + includes, then remote pull+up or up (readme §5.3).

func RunRemoteArtifactsFinish

func RunRemoteArtifactsFinish(client *ssh.Client, cfg *config.Config, composeFileOverride string, skipPull bool, exportDeployImage bool) error

RunRemoteArtifactsFinish runs config-check, then pull+up or up only (save/load), with optional compose file override. exportDeployImage adds export DEPLOY_IMAGE=... when true (compose file still references ${DEPLOY_IMAGE}).

func RunRemoteReup

func RunRemoteReup(client *ssh.Client, cfg *config.Config) error

RunRemoteReup runs config-check (if app_config) then docker compose build --pull, up -d, ps on the remote host.

func RunSource

func RunSource(projectRoot string, cfg *config.Config) error

RunSource syncs the project tree over SFTP then runs remote reup (readme §5.3).

func RunWithOptions

func RunWithOptions(projectRoot string, cfg *config.Config, opts RunOpts) error

RunWithOptions is like Run but honors CLI flags in opts (e.g. Build).

func SyncDeployIncludes

func SyncDeployIncludes(c *sftp.Client, projectRoot, remoteRoot string, cfg *config.Config) error

SyncDeployIncludes uploads extra paths from the project root (readme deploy_include).

func UploadAppConfig

func UploadAppConfig(c *sftp.Client, projectRoot, remoteRoot string, cfg *config.Config) error

UploadAppConfig copies the app config from the project root to the remote tree when the file exists.

Types

type RunOpts

type RunOpts struct {
	// Build runs docker build -t deploy_image before save/load or registry push.
	Build bool
}

RunOpts carries CLI-only options for deploy (not read from docker-ops.yml).

Jump to

Keyboard shortcuts

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