deployctl

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const BUILDER_QUEUE_KEY = "unbind:build:queue"

Redis key for the queue

View Source
const DEPENDENT_SERVICES_QUEUE_KEY = "unbind:dependent-services:queue"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentController

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

Handles triggering builds for services

func NewDeploymentController

func NewDeploymentController(
	ctx context.Context,
	cancel context.CancelFunc,
	cfg *config.Config,
	k8s *k8s.KubeClient,
	redisClient *redis.Client,
	repositories *repositories.Repositories,
	githubClient *github.GithubClient,
	webeehookService *webhooks_service.WebhooksService,
	variableService *variables_service.VariablesService) *DeploymentController

func (*DeploymentController) AreDependenciesReady

func (self *DeploymentController) AreDependenciesReady(ctx context.Context, req DeploymentJobRequest) bool

AreDependenciesReady checks if all dependencies for a service are ready

func (*DeploymentController) CancelExistingJobs

func (self *DeploymentController) CancelExistingJobs(ctx context.Context, serviceID uuid.UUID) error

cancelExistingJobs marks all pending jobs for a service as cancelled in the DB and removes them from the queue

func (*DeploymentController) EnqueueDependentDeployment

func (self *DeploymentController) EnqueueDependentDeployment(ctx context.Context, req DeploymentJobRequest) (*ent.Deployment, error)

EnqueueDependentDeployment adds a deployment to the dependent services queue

func (*DeploymentController) EnqueueDeploymentJob

func (self *DeploymentController) EnqueueDeploymentJob(ctx context.Context, req DeploymentJobRequest) (job *ent.Deployment, err error)

EnqueueDeploymentJob adds a deployment to the queue

func (*DeploymentController) PopulateBuildEnvironment

func (self *DeploymentController) PopulateBuildEnvironment(ctx context.Context, serviceID uuid.UUID, gitTag *string) (map[string]string, error)

Populate build environment, take tag separately so we can use it to build from tag

func (*DeploymentController) StartAsync

func (self *DeploymentController) StartAsync()

Start queue processor

func (*DeploymentController) Stop

func (self *DeploymentController) Stop()

Stop stops the deployment manager

func (*DeploymentController) SyncJobStatuses

func (self *DeploymentController) SyncJobStatuses(ctx context.Context) error

SyncJobStatuses synchronizes the status of all processing jobs with Kubernetes

type DeploymentJobRequest

type DeploymentJobRequest struct {
	// If job has already been created in pending
	ExistingJobID       *uuid.UUID              `json:"existing_job_id"`
	ServiceID           uuid.UUID               `json:"service_id"`
	Source              schema.DeploymentSource `json:"source"`
	CommitSHA           string                  `json:"commit_sha"`
	CommitMessage       string                  `json:"commit_message"`
	Environment         map[string]string       `json:"environment"`
	Committer           *schema.GitCommitter    `json:"committer"`
	DependsOnServiceIDs []uuid.UUID             `json:"depends_on_service_ids,omitempty"`
	DisableBuildCache   bool                    `json:"disable_build_cache,omitempty"`
}

The request to deploy a service, includes environment for builder image

Jump to

Keyboard shortcuts

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