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

Method CreateDeployment

admin/deployments.go:37–63  ·  view source on GitHub ↗
(ctx context.Context, opts *CreateDeploymentOptions)

Source from the content-addressed store, hash-verified

35}
36
37func (s *Service) CreateDeployment(ctx context.Context, opts *CreateDeploymentOptions) (*database.Deployment, error) {
38 // Create the deployment
39 depl, err := s.DB.InsertDeployment(ctx, &database.InsertDeploymentOptions{
40 ProjectID: opts.ProjectID,
41 OwnerUserID: opts.OwnerUserID,
42 Environment: opts.Environment,
43 Branch: opts.Branch,
44 Editable: opts.Editable,
45 RuntimeHost: "", // Will be populated after provisioning in startDeploymentInner
46 RuntimeInstanceID: "", // Will be populated after provisioning in startDeploymentInner
47 RuntimeAudience: "", // Will be populated after provisioning in startDeploymentInner
48 Status: database.DeploymentStatusPending, // Initial status is pending so we can return a valid deployment state immediately
49 StatusMessage: "Provisioning...",
50 DesiredStatus: database.DeploymentStatusRunning,
51 })
52 if err != nil {
53 return nil, err
54 }
55
56 // Trigger reconcile deployment job
57 err = s.triggerDeploymentReconcileJob(ctx, depl.ID)
58 if err != nil {
59 return nil, err
60 }
61
62 return depl, nil
63}
64
65func (s *Service) StartDeployment(ctx context.Context, depl *database.Deployment) (*database.Deployment, error) {
66 // Update the desired deployment status to running

Callers 2

CreateProjectMethod · 0.95
RedeployProjectMethod · 0.95

Calls 2

InsertDeploymentMethod · 0.65

Tested by

no test coverage detected