HostingSiteManager class
Manages Firebase Hosting sites and firebase target:apply mappings.
The orchestrator uses this to:
- Verify the release site exists. Firebase auto-creates a site
called
<projectId>when the project is created, so this is almost always a no-op verify, but we still check becausefirebase deploy --only hosting:releasewill fail loudly if the target points at a missing site. - Create the beta site
<projectId>-beta. This is not auto- created and is the most common reason a fresh project's beta hosting deploy fails. - Apply target mappings into the project's
.firebasercsofirebase deploy --only hosting:release/hosting:betaworks.
All operations are idempotent: re-running has no effect when the resource already exists.
Template-agnostic: the same site/target wiring is used by Flutter web,
Jaspr client, and Jaspr static templates because the hosting public
path is set in firebase.json per-template (see
ConfigGenerator._hostingPublicPath at
oracular/lib/services/config_generator.dart:77-82).
Constructors
-
HostingSiteManager(String projectId, {required String workingDirectory, Map<
String, String> ? environment, ProcessRunner? runner})
Properties
- betaSiteId → String
-
Computed beta site id:
<projectId>-beta.no setter -
environment
→ Map<
String, String> ? -
Optional environment vars passed on every
firebaseinvocation. Critical: without this, firebase-tools inherits only the parent shell's env and falls back to~/.config/configstore/firebase-tools.jsonfor auth — which fails with "Failed to authenticate, have you run firebase login?" the moment the user logs out (or never logged in in the first place).final - hashCode → int
-
The hash code for this object.
no setterinherited
- projectId → String
-
Firebase project ID. Used as the release site id and as the prefix
for the beta site (
<projectId>-beta).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- workingDirectory → String
-
Working directory for any
firebaseinvocation that needs to touch.firebaserc/firebase.json(i.e. applyTargets).final
Methods
-
applyTargets(
{String releaseTarget = 'release', String betaTarget = 'beta'}) → Future< ApplyTargetsResult> -
Apply
firebase target:apply hosting release <projectId>andfirebase target:apply hosting beta <projectId>-betasofirebase deploy --only hosting:release|hosting:betaworks. -
ensureBetaSite(
) → Future< SiteEnsureResult> -
Ensure the beta hosting site
<projectId>-betaexists. -
ensureReleaseSite(
) → Future< SiteEnsureResult> - Ensure the release hosting site exists.
-
listSites(
) → Future< List< String> ?> -
List the hosting site ids for this project. Returns
nullwhen the CLI invocation failed (auth / network / not-found etc) so callers can fall back to the optimistic create flow. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited