Documentation
¶
Overview ¶
Package sync applies deployment GitOps syncs: it clones the source, stages and promotes project files, and redeploys the linked project or stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs deployment syncs. Shared sync limits, error events and job registration stay with the parent and arrive as callbacks.
func New ¶
func New( db *database.DB, repoService *gitrepo.GitRepositoryService, projectService *projectpkg.ProjectService, swarmService *swarm.SwarmService, eventService *event.EventService, limits func(context.Context, *projectpkg.GitOpsSync) (int, int64, int64), logError func(context.Context, *projectpkg.GitOpsSync, user.Actor, string), unregisterJob func(context.Context, string), ) *Service
func (*Service) DirectoryProject ¶
func (s *Service) DirectoryProject(ctx context.Context, sync *projectpkg.GitOpsSync) (*projectpkg.Project, error)
DirectoryProject resolves the linked project for a directory sync, relinking or recovering it when the stored reference is stale. A sync whose project is gone and cannot be recovered has a broken binding.
func (*Service) Run ¶
func (s *Service) Run(ctx context.Context, sync *projectpkg.GitOpsSync, actor user.Actor, result *gitops.SyncResult) (*gitops.SyncResult, error)
Run clones the sync source and applies it to its project or Swarm stack. A retry replays the revision its run pinned, and redeploys it unless the record already confirms that revision.