MCPcopy Create free account
hub / github.com/nhost/nhost / commandCloud

Function commandCloud

cli/cmd/dev/cloud.go:93–141  ·  view source on GitHub ↗
(ctx context.Context, cmd *cli.Command)

Source from the content-addressed store, hash-verified

91}
92
93func commandCloud(ctx context.Context, cmd *cli.Command) error {
94 ce := clienv.FromCLI(cmd)
95
96 if !clienv.PathExists(ce.Path.NhostToml()) {
97 return errors.New( //nolint:err113
98 "no nhost project found, please run `nhost init` or `nhost config pull`",
99 )
100 }
101
102 if !clienv.PathExists(ce.Path.Secrets()) {
103 return errors.New( //nolint:err113
104 "no secrets found, please run `nhost init` or `nhost config pull`",
105 )
106 }
107
108 proj, err := ce.GetAppInfo(ctx, cmd.String(flagSubdomain))
109 if err != nil {
110 return fmt.Errorf("failed to get app info: %w", err)
111 }
112
113 configserverImage := cmd.String(flagConfigserverImage)
114 if configserverImage == "" {
115 configserverImage = "nhost/cli:" + cmd.Root().Version
116 }
117
118 applySeeds := cmd.Bool(flagApplySeeds)
119
120 return Cloud(
121 ctx,
122 ce,
123 cmd.Root().Version,
124 cmd.Uint(flagHTTPPort),
125 !cmd.Bool(flagDisableTLS),
126 applySeeds,
127 dockercompose.ExposePorts{
128 Auth: cmd.Uint(flagAuthPort),
129 Storage: cmd.Uint(flagStoragePort),
130 Graphql: cmd.Uint(flagsHasuraPort),
131 Console: cmd.Uint(flagsHasuraConsolePort),
132 Functions: cmd.Uint(flagsFunctionsPort),
133 },
134 cmd.String(flagDashboardVersion),
135 configserverImage,
136 cmd.String(flagCACertificates),
137 cmd.Bool(flagDownOnError),
138 proj,
139 cmd.String(flagPostgresURL),
140 )
141}
142
143func cloud( //nolint:funlen
144 ctx context.Context,

Callers

nothing calls this directly

Calls 9

FromCLIFunction · 0.92
PathExistsFunction · 0.92
NhostTomlMethod · 0.80
SecretsMethod · 0.80
GetAppInfoMethod · 0.80
ErrorfMethod · 0.80
RootMethod · 0.80
CloudFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected