Skip to content

feat(ng-deploy): add option to specify firebaseProject (#2281) (#2063) #2366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/schematics/deploy/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ export default async function deploy(
}

try {
await firebaseTools.use(firebaseProject, { project: firebaseProject });
await firebaseTools.use(firebaseProject, { project: firebaseProject }).then(() => {
console.log(`🔥 Your configured Firebase project is '${firebaseProject}'`);
});
} catch (e) {
throw new Error(`Cannot select firebase project '${firebaseProject}'`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/schematics/deploy/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default createBuilder<any>(

const projectTargets = workspace.getProjectTargets(context.target.project);

const firebaseProject = getFirebaseProjectName(
const firebaseProject = options.firebaseProject || getFirebaseProjectName(
context.workspaceRoot,
context.target.project
);
Expand Down
4 changes: 4 additions & 0 deletions src/schematics/deploy/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"description": "Target to build.",
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
},
"firebaseProject": {
"type": "string",
"description": "The firebase project name or project alias to use when deploying"
},
"preview": {
"type": "boolean",
"description": "Do not deploy the application, just set up the Firebase Function in the project output directory. Can be used for testing the Firebase Function with `firebase serve`."
Expand Down
1 change: 1 addition & 0 deletions src/schematics/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface FirebaseRc {

export interface DeployBuilderSchema {
buildTarget?: string;
firebaseProject?: string;
preview?: boolean;
universalBuildTarget?: string;
ssr?: boolean;
Expand Down