Documentation
¶
Index ¶
- Constants
- func BuildImage(name, srcDir string, cfg *shared.Config, opts BuildOpts, ...) (string, error)
- func CloneRepo(remote store.RemoteObj, destDir string, config *shared.Config) error
- func DeployApp(bp store.Blueprint, name, logPath string, cfg *shared.Config, ...) error
- func PullImage(imageRef string, config *shared.Config, dockerCli deployDockerAPI) error
- func ResolveStaticDir(workDir, staticDir string) string
- func SetupDir(name string) (string, error)
- func WriteEnvFile(workDir string, bp store.Blueprint, port int) error
- type BuildOpts
- type ContainerConfig
- type Deployer
- func (d *Deployer) Build(ctx context.Context, req *deploy.BuildRequest) (*deploy.BuildResponse, error)
- func (d *Deployer) Deploy(ctx context.Context, req *deploy.DeployRequest) (*deploy.DeployResponse, error)
- func (d *Deployer) GetDeployment(ctx context.Context, id string) (*store.Deployment, error)
- func (d *Deployer) ListDeployments(ctx context.Context, userID string, limit, offset int) ([]*store.Deployment, error)
- func (d *Deployer) Publish(ctx context.Context, req *deploy.PublishRequest) (*deploy.DeployResponse, error)
- func (d *Deployer) UpdateDeploymentStatus(ctx context.Context, id string, status store.Status) error
- type Dispatcher
Constants ¶
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 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
PullImage pulls a docker image from a registry using the Docker SDK.
func ResolveStaticDir ¶ added in v0.6.34
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 WriteEnvFile ¶ added in v0.6.34
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
BuilderImage string // resolved primary FROM image; falls back to runtimeBaseImage when empty
RunnerImage string // resolved runner FROM image for multi-stage builds; falls back when empty
BuildCmd string
RunCmd string
Port int
IsNextJS bool
HealthCheckPath string // optional; defaults to root URL check if empty
Env map[string]string
}
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 (d *Deployer) Build(ctx context.Context, req *deploy.BuildRequest) (*deploy.BuildResponse, error)
func (*Deployer) Deploy ¶
func (d *Deployer) Deploy(ctx context.Context, req *deploy.DeployRequest) (*deploy.DeployResponse, error)
func (*Deployer) GetDeployment ¶
func (*Deployer) ListDeployments ¶
func (*Deployer) Publish ¶ added in v0.6.21
func (d *Deployer) Publish(ctx context.Context, req *deploy.PublishRequest) (*deploy.DeployResponse, error)
type Dispatcher ¶
type Dispatcher interface {
Submit(id string)
}