Documentation
¶
Index ¶
- Constants
- type DeploymentController
- func (self *DeploymentController) AreDependenciesReady(ctx context.Context, req DeploymentJobRequest) bool
- func (self *DeploymentController) CancelExistingJobs(ctx context.Context, serviceID uuid.UUID) error
- func (self *DeploymentController) EnqueueDependentDeployment(ctx context.Context, req DeploymentJobRequest) (*ent.Deployment, error)
- func (self *DeploymentController) EnqueueDeploymentJob(ctx context.Context, req DeploymentJobRequest) (job *ent.Deployment, err error)
- func (self *DeploymentController) PopulateBuildEnvironment(ctx context.Context, serviceID uuid.UUID, gitTag *string) (map[string]string, error)
- func (self *DeploymentController) StartAsync()
- func (self *DeploymentController) Stop()
- func (self *DeploymentController) SyncJobStatuses(ctx context.Context) error
- type DeploymentJobRequest
Constants ¶
const BUILDER_QUEUE_KEY = "unbind:build:queue"
Redis key for the queue
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