Documentation
¶
Overview ¶
Package deploy defines core deployment types, handlers, and orchestration interfaces used by the daemon for managing application deployments. High-level deployment workflows, lifecycle management, and integration logic are implemented in the internal/deploy package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildHandler ¶ added in v0.6.21
type BuildHandler struct {
// contains filtered or unexported fields
}
func NewBuildHandler ¶ added in v0.6.21
func NewBuildHandler(deployer *Deployer, logger *shared.Logger) *BuildHandler
func (*BuildHandler) HandleBuild ¶ added in v0.6.21
func (h *BuildHandler) HandleBuild(w http.ResponseWriter, r *http.Request)
HandleBuild is called on build nodes. It executes the build, pushes the image, and returns the image reference in the task result.
func (*BuildHandler) HandlePublish ¶ added in v0.6.21
func (h *BuildHandler) HandlePublish(w http.ResponseWriter, r *http.Request)
HandlePublish is called on instance nodes when a build node finishes. It receives the built image reference and runs it as a deployment.
type BuildRequest ¶ added in v0.6.21
type BuildRequest struct {
DeployRequest
CallbackInstance string `json:"callback_instance"`
}
type BuildResponse ¶ added in v0.6.21
type BuildResponse struct {
Image string `json:"image"`
}
type DeployRequest ¶
type DeployRequest struct {
Name string `json:"name" validate:"required"`
Description string `json:"description,omitempty"`
UserId string `json:"user_id" validate:"required"`
Type string `json:"type" validate:"required,oneof= static web worker job"`
Source string `json:"source" validate:"required,oneof=remote image"`
Runtime string `json:"runtime" validate:"required,oneof=static golang php python nodejs ruby dotnet java"`
Version string `json:"version,omitempty"`
RunCmd string `json:"run_cmd,omitempty"`
BuildCmd string `json:"build_cmd,omitempty"`
Port int `json:"port,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
StaticDir string `json:"static_dir,omitempty"`
Image string `json:"image,omitempty"`
EnvVars map[string]any `json:"env_vars,omitempty"`
Secrets map[string]any `json:"secrets,omitempty"`
Remote store.RemoteObj `json:"remote,omitempty"`
Domain string `json:"domain,omitempty"`
HealthCheck *store.HealthCheck `json:"health_check,omitempty"`
}
func (*DeployRequest) GetRuntimeObj ¶ added in v0.4.11
func (dr *DeployRequest) GetRuntimeObj() store.RuntimeObj
type DeployResponse ¶
type Deployer ¶
type Deployer struct {
// contains filtered or unexported fields
}
func NewDeployer ¶
func NewDeployer(c *shared.Config, l *shared.Logger, s store.DeploymentStore, a HandleDeployment) *Deployer
type DeploymentHandler ¶
type DeploymentHandler struct {
// contains filtered or unexported fields
}
func NewDeploymentHandler ¶
func NewDeploymentHandler(deployer *Deployer, logger *shared.Logger) *DeploymentHandler
func (*DeploymentHandler) CreateDeployment ¶
func (h *DeploymentHandler) CreateDeployment(w http.ResponseWriter, r *http.Request)
func (*DeploymentHandler) ListDeployments ¶
func (h *DeploymentHandler) ListDeployments(w http.ResponseWriter, r *http.Request)
type HandleDeployment ¶
type HandleDeployment interface {
Deploy(ctx context.Context, req *DeployRequest) (*DeployResponse, error)
Build(ctx context.Context, req *BuildRequest) (*BuildResponse, error)
Publish(ctx context.Context, req *PublishRequest) (*DeployResponse, error)
GetDeployment(ctx context.Context, id string) (*store.Deployment, error)
ListDeployments(ctx context.Context, id string, limit, offset int) ([]*store.Deployment, error)
UpdateDeploymentStatus(ctx context.Context, id string, status store.Status) error
}
type PublishRequest ¶ added in v0.6.21
type PublishRequest struct {
Image string `json:"image"`
Payload DeployRequest `json:"payload"`
}
Click to show internal directories.
Click to hide internal directories.