Skip to content

Commit 20ddd15

Browse files
authored
Check billing during App Hosting init and move App Hosting option next to Hosting in init list (#7871)
* check billing & move app hosting up in init list
1 parent df2f682 commit 20ddd15

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
- Check that billing is enabled and move App Hosting next to Hosting in init list (#7871).
12
- Fix rollouts:create to handle backend regionality & other fixes. (#7862)
23
- Fixed Next.js issue with PPR routes not rendering correctly. (#7625)

src/commands/init.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ let choices: {
4545
name: "Functions: Configure a Cloud Functions directory and its files",
4646
checked: false,
4747
},
48+
{
49+
value: "apphosting",
50+
name: "App Hosting: Configure an apphosting.yaml file for App Hosting",
51+
checked: false,
52+
hidden: false,
53+
},
4854
{
4955
value: "hosting",
5056
name: "Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys",
@@ -87,12 +93,6 @@ let choices: {
8793
checked: false,
8894
hidden: true,
8995
},
90-
{
91-
value: "apphosting",
92-
name: "App Hosting: Configure an apphosting.yaml file for App Hosting",
93-
checked: false,
94-
hidden: false,
95-
},
9696
];
9797

9898
if (isEnabled("genkit")) {

src/init/features/apphosting.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import * as clc from "colorette";
22
import * as utils from "../../utils";
33
import { Config } from "../../config";
44
import { readTemplateSync } from "../../templates";
5+
import { checkBillingEnabled } from "../../gcp/cloudbilling";
56

67
const APPHOSTING_YAML_TEMPLATE = readTemplateSync("init/apphosting/apphosting.yaml");
78

89
/**
910
* Set up an apphosting.yaml file for a new App Hosting project.
1011
*/
1112
export async function doSetup(setup: any, config: Config): Promise<void> {
13+
await checkBillingEnabled(setup.projectId);
1214
utils.logBullet("Writing default settings to " + clc.bold("apphosting.yaml") + "...");
1315
await config.askWriteProjectFile("apphosting.yaml", APPHOSTING_YAML_TEMPLATE);
16+
utils.logSuccess("Create a new App Hosting backend with `firebase apphosting:backends:create`");
1417
}

0 commit comments

Comments
 (0)