MCPcopy
hub / github.com/angular/angularfire / deployToHosting

Function deployToHosting

src/schematics/deploy/actions.ts:66–107  ·  view source on GitHub ↗
(
  firebaseTools: FirebaseTools,
  context: BuilderContext,
  workspaceRoot: string,
  options: DeployBuilderOptions,
  firebaseToken?: string,
)

Source from the content-addressed store, hash-verified

64};
65
66const deployToHosting = async (
67 firebaseTools: FirebaseTools,
68 context: BuilderContext,
69 workspaceRoot: string,
70 options: DeployBuilderOptions,
71 firebaseToken?: string,
72) => {
73
74 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
75 const siteTarget = options.target ?? context.target!.project;
76
77 if (options.preview) {
78
79 await firebaseTools.serve({
80 port: DEFAULT_EMULATOR_PORT,
81 host: DEFAULT_EMULATOR_HOST,
82 only: `hosting:${siteTarget}`,
83 nonInteractive: true,
84 projectRoot: workspaceRoot,
85 });
86
87 const { deployProject } = await inquirer.prompt({
88 type: 'confirm',
89 name: 'deployProject',
90 message: 'Would you like to deploy your application to Firebase Hosting?'
91 }) as { deployProject: boolean };
92
93 if (!deployProject) { return; }
94
95 process.env.FIREBASE_FRAMEWORKS_SKIP_BUILD = 'true';
96
97 }
98
99 return await firebaseTools.deploy({
100 only: `hosting:${siteTarget}`,
101 cwd: workspaceRoot,
102 token: firebaseToken,
103 nonInteractive: true,
104 projectRoot: workspaceRoot,
105 });
106
107};
108
109const defaultFsHost: FSHost = {
110 moveSync,

Callers 1

deployFunction · 0.85

Calls 2

serveMethod · 0.80
deployMethod · 0.80

Tested by

no test coverage detected