Walk up from the terraform dir to find the repo root (the one with the Dockerfile context).
(tfDir: string)
| 424 | |
| 425 | /** Walk up from the terraform dir to find the repo root (the one with the Dockerfile context). */ |
| 426 | function findRepoRoot(tfDir: string): string | null { |
| 427 | // tfDir is <root>/packages/gcp-cloud-run/terraform |
| 428 | const candidate = resolve(tfDir, "..", "..", ".."); |
| 429 | if (existsSync(join(candidate, "packages", "gcp-cloud-run", "Dockerfile"))) return candidate; |
| 430 | return null; |
| 431 | } |
| 432 | |
| 433 | function writeCloudBuildConfig(image: string): string { |
| 434 | const cfgPath = join(stateDir(), "cloudrun-cloudbuild.yaml"); |