| 1 | import { GcpEnvironment } from "@/GCP/Environment"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { MinimumLogLevel } from "effect/References"; |
| 4 | |
| 5 | export const logLevel = Effect.provideService( |
| 6 | MinimumLogLevel, |
| 7 | process.env.DEBUG ? "Debug" : "Info", |
| 8 | ); |
| 9 | |
| 10 | export const enterpriseName = |
| 11 | process.env.GCP_ANDROIDMANAGEMENT_ENTERPRISE?.trim() || undefined; |
| 12 | |
| 13 | // Android Management needs credentials carrying the androidmanagement scope |
| 14 | // (plus an enterprise signup); the service account profile is rejected with |
| 15 | // InsufficientScopes. Set |
| 16 | // GCP_TEST_ANDROIDMANAGEMENT_OAUTH=1 with such credentials. |
| 17 | export const runLifecycle = !!process.env.GCP_TEST_ANDROIDMANAGEMENT_OAUTH; |
| 18 | |
| 19 | export const runChildLifecycle = runLifecycle && !!enterpriseName; |
| 20 | |
| 21 | export const currentProject = GcpEnvironment.current.pipe( |
| 22 | Effect.map((env) => env.project), |
| 23 | ); |