MCPcopy
hub / github.com/hasura/graphql-engine / NewProjectDeploy

Function NewProjectDeploy

cli/pkg/deploy/project_deploy.go:53–77  ·  view source on GitHub ↗
(projectDirectory string, opts ...ProjectDeployOption)

Source from the content-addressed store, hash-verified

51}
52
53func NewProjectDeploy(projectDirectory string, opts ...ProjectDeployOption) (*ProjectDeploy, error) {
54 var op errors.Op = "deploy.NewProjectDeploy"
55 ec := cli.NewExecutionContext()
56 ec.ExecutionDirectory = projectDirectory
57 ec.Viper = viper.New()
58 ec.IsTerminal = false
59 ec.Stdout = io.Discard
60 ec.Stderr = io.Discard
61
62 if err := ec.Prepare(); err != nil {
63 return nil, errors.E(op, err)
64 }
65 d := &ProjectDeploy{ec}
66 for _, opt := range opts {
67 opt(d)
68 }
69
70 if err := ec.Validate(); err != nil {
71 return nil, errors.E(op, err)
72 }
73 if ec.Config.Version <= cli.V1 {
74 return nil, errors.E(op, fmt.Errorf("config %v is not supported", ec.Config.Version))
75 }
76 return d, nil
77}

Calls 2

PrepareMethod · 0.95
ValidateMethod · 0.95