1import { GcpEnvironment } from "@/GCP/Environment";
2import * as Effect from "effect/Effect";
3import { MinimumLogLevel } from "effect/References";
4
5export const logLevel = Effect.provideService(
6 MinimumLogLevel,
7 process.env.DEBUG ? "Debug" : "Info",
8);
9
10export 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.
17export const runLifecycle = !!process.env.GCP_TEST_ANDROIDMANAGEMENT_OAUTH;
18
19export const runChildLifecycle = runLifecycle && !!enterpriseName;
20
21export const currentProject = GcpEnvironment.current.pipe(
22 Effect.map((env) => env.project),
23);