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

Function deploy

cli/cmd/project/init.go:192–235  ·  view source on GitHub ↗
(
	ctx context.Context,
	ce *clienv.CliEnv,
	cfg *model.ConfigConfig,
	hasuraEndpoint string,
	hasuraAdminSecret string,
)

Source from the content-addressed store, hash-verified

190}
191
192func deploy(
193 ctx context.Context,
194 ce *clienv.CliEnv,
195 cfg *model.ConfigConfig,
196 hasuraEndpoint string,
197 hasuraAdminSecret string,
198) error {
199 docker := dockercompose.NewDocker()
200
201 ce.Infoln("Creating postgres migration")
202
203 if err := docker.HasuraWrapper(
204 ctx,
205 ce.LocalSubdomain(),
206 ce.Path.NhostFolder(),
207 *cfg.Hasura.Version,
208 "migrate", "create", "init", "--from-server", "--schema", "public",
209 "--database-name", "default",
210 "--skip-update-check",
211 "--log-level", "ERROR",
212 "--endpoint", hasuraEndpoint,
213 "--admin-secret", hasuraAdminSecret,
214 ); err != nil {
215 return fmt.Errorf("failed to create postgres migration: %w", err)
216 }
217
218 ce.Infoln("Downloading metadata...")
219
220 if err := docker.HasuraWrapper(
221 ctx,
222 ce.LocalSubdomain(),
223 ce.Path.NhostFolder(),
224 *cfg.Hasura.Version,
225 "metadata", "export",
226 "--skip-update-check",
227 "--log-level", "ERROR",
228 "--endpoint", hasuraEndpoint,
229 "--admin-secret", hasuraAdminSecret,
230 ); err != nil {
231 return fmt.Errorf("failed to create metadata: %w", err)
232 }
233
234 return nil
235}

Callers 1

InitRemoteFunction · 0.85

Calls 6

HasuraWrapperMethod · 0.95
NewDockerFunction · 0.92
InfolnMethod · 0.80
LocalSubdomainMethod · 0.80
NhostFolderMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected