Skip to content

Commit

Permalink
Check billing during App Hosting init and move App Hosting option nex…
Browse files Browse the repository at this point in the history
…t to Hosting in init list (#7871)

* check billing & move app hosting up in init list
  • Loading branch information
blidd-google authored Oct 30, 2024
1 parent df2f682 commit 20ddd15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Check that billing is enabled and move App Hosting next to Hosting in init list (#7871).
- Fix rollouts:create to handle backend regionality & other fixes. (#7862)
- Fixed Next.js issue with PPR routes not rendering correctly. (#7625)
12 changes: 6 additions & 6 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ let choices: {
name: "Functions: Configure a Cloud Functions directory and its files",
checked: false,
},
{
value: "apphosting",
name: "App Hosting: Configure an apphosting.yaml file for App Hosting",
checked: false,
hidden: false,
},
{
value: "hosting",
name: "Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys",
Expand Down Expand Up @@ -87,12 +93,6 @@ let choices: {
checked: false,
hidden: true,
},
{
value: "apphosting",
name: "App Hosting: Configure an apphosting.yaml file for App Hosting",
checked: false,
hidden: false,
},
];

if (isEnabled("genkit")) {
Expand Down
3 changes: 3 additions & 0 deletions src/init/features/apphosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import * as clc from "colorette";
import * as utils from "../../utils";
import { Config } from "../../config";
import { readTemplateSync } from "../../templates";
import { checkBillingEnabled } from "../../gcp/cloudbilling";

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

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

0 comments on commit 20ddd15

Please # to comment.