(ctx context.Context, cmd *cli.Command)
| 91 | } |
| 92 | |
| 93 | func 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 | |
| 143 | func cloud( //nolint:funlen |
| 144 | ctx context.Context, |
nothing calls this directly
no test coverage detected