Documentation
¶
Overview ¶
Package release turns the per-application Release (a deployed, rollback-able version) into a promotable artifact: a workspace-wide catalog with provenance, approval gates per environment, and promotion (re-pointing an application at a release) that the gate guards.
Index ¶
- Variables
- type ApprovalStatus
- type EnvApproval
- type Service
- func (s *Service) Approvals(workspaceID, releaseID uint) (*ApprovalStatus, error)
- func (s *Service) Approve(workspaceID, releaseID uint, environmentID *uint, approverID uint, ...) error
- func (s *Service) List(workspaceID uint) ([]View, error)
- func (s *Service) ListPaged(workspaceID uint, limit, offset int) ([]View, int64, error)
- func (s *Service) Promote(workspaceID, releaseID, environmentID, userID uint) (*models.Deployment, error)
- type View
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ApprovalStatus ¶
type ApprovalStatus struct {
Environments []EnvApproval `json:"environments"`
Approvals []models.ReleaseApproval `json:"approvals"`
}
ApprovalStatus is a release's approval standing across all environments plus the raw approval log.
type EnvApproval ¶
type EnvApproval struct {
EnvironmentID uint `json:"environment_id"`
EnvironmentName string `json:"environment_name"`
RequiredApprovals int `json:"required_approvals"`
Approvals int `json:"approvals"`
Satisfied bool `json:"satisfied"`
}
EnvApproval reports a release's approval standing for one environment.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service exposes the workspace release catalog, approvals, and promotion.
func NewService ¶
func NewService(releases *repositories.ReleaseRepository, apps *repositories.ApplicationRepository, envs *repositories.EnvironmentRepository, appSvc *application.Service) *Service
NewService wires the release service.
func (*Service) Approvals ¶
func (s *Service) Approvals(workspaceID, releaseID uint) (*ApprovalStatus, error)
Approvals returns the approval standing of a release across the workspace's environments.
func (*Service) Approve ¶
func (s *Service) Approve(workspaceID, releaseID uint, environmentID *uint, approverID uint, approved bool, comment string) error
Approve records one approver's decision on promoting a release into an environment.
func (*Service) List ¶
List returns every release in the workspace, newest first, with app identity.
func (*Service) ListPaged ¶
ListPaged returns a page of workspace releases (with app identity) plus the total count.
func (*Service) Promote ¶
func (s *Service) Promote(workspaceID, releaseID, environmentID, userID uint) (*models.Deployment, error)
Promote re-points the release's application at it (making it the active release), gated by the target environment's required approvals. Driven through the existing deploy pipeline.