diff --git a/skills/firebase-app-hosting-basics/references/cli_commands.md b/skills/firebase-app-hosting-basics/references/cli_commands.md index e4c0a2c34e9..e1baf5b5725 100644 --- a/skills/firebase-app-hosting-basics/references/cli_commands.md +++ b/skills/firebase-app-hosting-basics/references/cli_commands.md @@ -3,7 +3,9 @@ The Firebase CLI provides a comprehensive suite of commands to manage App Hosting resources. These commands are often faster and more scriptable than using the Firebase Console. ## Initialization + ### `firebase init apphosting` + - **Purpose**: Interactive command that sets up App Hosting in your local project. Use this command only if you are able to handle interactive CLI inputs well. Alternatively, you can manually edit `firebase.json` and `apphosting.yml`. @@ -14,42 +16,56 @@ Alternatively, you can manually edit `firebase.json` and `apphosting.yml`. - Can optionally create a backend if one doesn't exist. ## Backend Management -### `firebase apphosting:backends:create` -- **Purpose**: Creates a new App Hosting backend. Use this when setting up automated deployments via GitHub. -- **Options**: - - `--app `: The ID of an existing Firebase web app to associate with the backend. - - `--backend `: The ID of the new backend. - - `--primary-region `: The primary region for the backend. - - `--root-dir `: The root directory for the backend. If omitted, defaults to the root directory of the project. - - `--service-account `: The service account used to run the server. If omitted, defaults to the default service account. ### `firebase apphosting:backends:list` + - **Purpose**: Lists all backends in the current project. ### `firebase apphosting:backends:get ` + - **Purpose**: Shows details for a specific backend. ### `firebase apphosting:backends:delete ` -- **Purpose**: Deletes a backend and its associated resources. -## Rollouts (Deployment) -### `firebase apphosting:rollouts:create ` -- **Purpose**: Manually triggers a new rollout (deployment). -- **Options**: - - `--git-branch `: Deploy the latest commit from a specific branch. - - `--git-commit `: Deploy a specific commit. -- **Use Case**: Useful for redeploying without code changes, or rolling back to a specific commit. +- **Purpose**: Deletes a backend and its associated resources. ### `firebase apphosting:rollouts:list ` + - **Purpose**: Lists the history of rollouts for a backend. ## Secrets Management + App Hosting uses Cloud Secret Manager to securely handle sensitive environment variables (like API keys). ### `firebase apphosting:secrets:set ` + - **Purpose**: Creates or updates a secret in Cloud Secret Manager and makes it available to App Hosting. - **Behavior**: Prompts for the secret value (hidden input). ### `firebase apphosting:secrets:grantaccess ` + - **Purpose**: Grants the App Hosting service account permission to access the secret. - **Note**: Often handled automatically by `secrets:set`, but useful for debugging permission issues or granting access to existing secrets. + +## Automated deployment via GitHub (CI/CD) + +**IMPORTANT** Only use these commands if you are setting up automated deployments via GitHub. If you are managing deployments using `firebase deploy`, DO NOT use these commands. + +### `firebase apphosting:rollouts:create ` + +- **Purpose**: Manually triggers a new rollout (deployment). +- **Options**: + - `--git-branch `: Deploy the latest commit from a specific branch. + - `--git-commit `: Deploy a specific commit. +- **Use Case**: Useful for redeploying without code changes, or rolling back to a specific commit. + +### `firebase apphosting:backends:create` + +- **Purpose**: Creates a new App Hosting backend. Use this when setting up automated deployments via GitHub. +- **Options**: + - `--app `: The ID of an existing Firebase web app to associate with the backend. + - `--backend `: The ID of the new backend. + - `--primary-region `: The primary region for the backend. + - `--root-dir `: The root directory for the backend. If omitted, defaults to the root directory of the project. + - `--service-account `: The service account used to run the server. If omitted, defaults to the default service account. + \ No newline at end of file