runAll method
Run all three preflights in order. Returns true only when the
project is ready for docker push + gcloud run deploy.
ensureCloudRunPrerequisiteApis is allowed to soft-fail (the
docker push step prints a clearer error if the API really is
off), so its result is not propagated as a hard failure.
verifyActiveGcloudAccount and ensureArtifactRegistryRepository
are hard gates.
Implementation
Future<bool> runAll({
required String projectId,
required String repository,
required String region,
}) async {
if (!await verifyActiveGcloudAccount(projectId: projectId)) {
return false;
}
if (!await ensureCloudRunPrerequisiteApis(projectId: projectId)) {
warn('Could not confirm Artifact Registry / Cloud Run APIs are '
'enabled. Continuing — push will fail with a clear error if '
'they really are off.');
}
if (!await ensureArtifactRegistryRepository(
projectId: projectId,
repository: repository,
region: region,
)) {
error('Could not ensure Artifact Registry repository '
'`$repository` in $region exists. Push will fail without it.');
return false;
}
return true;
}