deploy

package
v0.6.36 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const DockerIgnoreContent = `` /* 1163-byte string literal not displayed */

DockerIgnoreContent defines patterns to exclude from Docker builds

Variables

This section is empty.

Functions

func BuildImage added in v0.6.21

func BuildImage(name, srcDir string, cfg *shared.Config, opts BuildOpts, dockerCli deployDockerAPI) (string, error)

func CloneRepo

func CloneRepo(remote store.RemoteObj, destDir string, config *shared.Config) error

CloneRepo clones a git repository to the specified directory

func DeployApp

func DeployApp(bp store.Blueprint, name, logPath string, cfg *shared.Config, dockerCli deployDockerAPI) error

DeployApp handles runtime setup, build, and service installation. Jobs (TypeJob) use the systemd/vfox bash path; all other types use the Go Docker path which avoids the bash script entirely.

func PullImage added in v0.6.0

func PullImage(imageRef string, config *shared.Config, dockerCli deployDockerAPI) error

PullImage pulls a docker image from a registry using the Docker SDK.

func ResolveStaticDir added in v0.6.34

func ResolveStaticDir(workDir, staticDir string) string

resolveStaticDir returns the absolute host path for the static content directory. Relative paths are joined with workDir; absolute paths are returned unchanged. Empty staticDir returns workDir itself.

func SetupDir

func SetupDir(name string) (string, error)

SetupDir creates a working directory for the deployment

func WriteEnvFile added in v0.6.34

func WriteEnvFile(workDir string, bp store.Blueprint, port int) error

WriteEnvFile writes <workDir>/.env from the blueprint's env vars and secrets, with PORT always written first. Duplicate keys are skipped — PORT wins over any env var named PORT, and env vars win over secrets with the same key.

Types

type BuildOpts added in v0.6.28

type BuildOpts struct {
	Runtime         string
	Version         string
	BuildCmd        string
	RunCmd          string
	Port            int
	IsNextJS        bool
	HealthCheckPath string // optional; defaults to root URL check if empty
}

type ContainerConfig added in v0.6.34

type ContainerConfig struct {
	Name        string
	Image       string
	Port        int      // container port; 0 skips port binding
	HostPort    int      // host port; 0 skips port binding
	Env         []string // KEY=value entries passed inline to the container
	Description string
	Type        store.ServiceType
	RunCmd      string // optional CMD override
	HealthCheck *store.HealthCheck
	Memory      int // MB; 0 = no limit
	CPU         int // millicores; 0 = no limit
	Storage     int // GB; 0 = no limit
}

ContainerConfig holds all parameters needed to create a Docker container. Build it from a Blueprint then call ContainerCfg() / HostCfg() to get the typed SDK structs — no shell invocations, fully testable.

func (*ContainerConfig) ContainerCfg added in v0.6.34

func (c *ContainerConfig) ContainerCfg() container.Config

ContainerCfg returns the container.Config for docker ContainerCreate.

func (*ContainerConfig) HostCfg added in v0.6.34

func (c *ContainerConfig) HostCfg() container.HostConfig

HostCfg returns the container.HostConfig for docker ContainerCreate.

type Deployer

type Deployer struct {
	// contains filtered or unexported fields
}

func Init

func Init(c *shared.Config, l *shared.Logger, s store.DeploymentStore, j Dispatcher, dockerCli deployDockerAPI) *Deployer

Init creates a new Deployer instance. dockerCli must satisfy deployDockerAPI (a *client.Client from github.com/docker/docker/client does so automatically).

func (*Deployer) Build added in v0.6.21

func (*Deployer) Deploy

func (*Deployer) GetDeployment

func (d *Deployer) GetDeployment(ctx context.Context, id string) (*store.Deployment, error)

func (*Deployer) ListDeployments

func (d *Deployer) ListDeployments(ctx context.Context, userID string, limit, offset int) ([]*store.Deployment, error)

func (*Deployer) Publish added in v0.6.21

func (*Deployer) UpdateDeploymentStatus

func (d *Deployer) UpdateDeploymentStatus(ctx context.Context, id string, status store.Status) error

type Dispatcher

type Dispatcher interface {
	Submit(id string)
}

Jump to

Keyboard shortcuts

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