CloudRunPreflight class
Shared Cloud Run / Artifact Registry preflights.
Both ServerSetup.deployToCloudRun (arcane_server) and
JasprServerDeployer.deploy (Jaspr SSR/hybrid) need the same three
preflight gates before any docker push or gcloud run deploy is
attempted:
- Active gcloud account sanity — catch the "wrong service
account active" foot-gun up front instead of letting it cascade
into ten lines of
PERMISSION_DENIEDdeep inside the push. - Required GCP APIs enabled —
artifactregistry.googleapis.comandrun.googleapis.com. Both are off by default on fresh projects. - Artifact Registry repository exists — without this
docker pushfails withNOT_FOUNDbecause the registry path doesn't resolve to a repo.
All three were originally private to ServerSetup; this class is
the single source of truth so the Jaspr deployer can reuse them
without re-implementing or duplicating.
Constructors
- CloudRunPreflight({ProcessRunner? runner})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
ensureArtifactRegistryRepository(
{required String projectId, required String repository, required String region}) → Future< bool> -
Ensure the Artifact Registry repository
<repository>@<region>exists forprojectId. Idempotent: a "already exists" / 409 response is treated as success. -
ensureCloudRunPrerequisiteApis(
{required String projectId}) → Future< bool> -
Enable the GCP services Cloud Run deployment depends on. Returns true
when all required APIs are enabled (or were already enabled), false
when at least one
gcloud services enablecall returns non-zero. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
runAll(
{required String projectId, required String repository, required String region}) → Future< bool> -
Run all three preflights in order. Returns
trueonly when the project is ready fordocker push+gcloud run deploy. -
toString(
) → String -
A string representation of this object.
inherited
-
verifyActiveGcloudAccount(
{required String projectId}) → Future< bool> -
Preflight: verify the active gcloud account is plausibly authorized
for
projectId. Returnstruewhen:
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited