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

Function createOrgFlow

cli/cmd/project/deploy.go:558–585  ·  view source on GitHub ↗
(ctx context.Context, ch *cmdutil.Helper)

Source from the content-addressed store, hash-verified

556}
557
558func createOrgFlow(ctx context.Context, ch *cmdutil.Helper) error {
559 c, err := ch.Client()
560 if err != nil {
561 return err
562 }
563
564 ch.PrintfBold("No organization found for your account. Creating a new organization.\n")
565 name, err := orgNamePrompt(ctx, ch)
566 if err != nil {
567 return err
568 }
569
570 res, err := c.CreateOrganization(ctx, &adminv1.CreateOrganizationRequest{
571 Name: name,
572 })
573 if err != nil {
574 return err
575 }
576
577 // Switching to the created org
578 ch.Org = res.Organization.Name
579 err = ch.DotRill.SetDefaultOrg(ch.Org)
580 if err != nil {
581 return err
582 }
583
584 return nil
585}
586
587func orgNamePrompt(ctx context.Context, ch *cmdutil.Helper) (string, error) {
588 qs := []*survey.Question{

Callers 2

ConnectGithubFlowFunction · 0.85
DeployWithUploadFlowFunction · 0.85

Calls 5

orgNamePromptFunction · 0.85
PrintfBoldMethod · 0.80
SetDefaultOrgMethod · 0.80
CreateOrganizationMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected