MCPcopy Index your code
hub / github.com/rilldata/rill / UpdateDeployment

Method UpdateDeployment

admin/deployments.go:97–119  ·  view source on GitHub ↗
(ctx context.Context, depl *database.Deployment, branch string)

Source from the content-addressed store, hash-verified

95}
96
97func (s *Service) UpdateDeployment(ctx context.Context, depl *database.Deployment, branch string) error {
98 // Update the deployment with the new branch (or existing branch) and set existing desired status to retrigger reconcile flow
99 var err error
100 if branch != depl.Branch {
101 _, err = s.DB.UpdateDeploymentSafe(ctx, depl.ID, &database.UpdateDeploymentSafeOptions{
102 DesiredStatus: depl.DesiredStatus,
103 Branch: branch,
104 })
105 } else {
106 _, err = s.DB.UpdateDeploymentDesiredStatus(ctx, depl.ID, depl.DesiredStatus)
107 }
108 if err != nil {
109 return err
110 }
111
112 // Trigger reconcile deployment job
113 err = s.triggerDeploymentReconcileJob(ctx, depl.ID)
114 if err != nil {
115 return err
116 }
117
118 return nil
119}
120
121func (s *Service) TeardownDeployment(ctx context.Context, depl *database.Deployment) error {
122 // Update the desired deployment status to deleted

Callers 1

Tested by

no test coverage detected