|
1 | 1 | import {DeploymentInfo, deployToSite, isProductionDeployment} from './deploy-to-site.mjs';
|
2 | 2 |
|
3 |
| -import {buildDocsContentPackage} from '../build-docs-content.mjs'; |
4 |
| -import {cloneDocsRepositoryForMajor} from './clone-docs-repo.mjs'; |
5 |
| -import {installBuiltPackagesInRepo} from './install-built-packages.mjs'; |
6 |
| -import {installDepsAndBuildDocsSite} from './utils.mjs'; |
7 |
| -import {performDefaultSnapshotBuild} from '../build-packages-dist.mjs'; |
8 | 3 | import {runMonitoringTests} from './monitoring/index.mjs';
|
| 4 | +import {buildDocsSite, projectDir} from './utils.mjs'; |
9 | 5 |
|
10 | 6 | export type DeploymentConfig = {
|
11 | 7 | /**
|
12 | 8 | * Optional hook running before building the docs-app for deployment.
|
13 |
| - * |
14 |
| - * Runs after the docs-content and local packages have been installed |
15 |
| - * in the docs repository. |
16 | 9 | */
|
17 |
| - prebuild?: (docsRepoDir: string) => Promise<void> | void; |
| 10 | + prebuild?: (workspaceDir: string) => Promise<void> | void; |
18 | 11 | };
|
19 | 12 |
|
20 | 13 | /**
|
@@ -48,32 +41,17 @@ export async function buildAndDeployWithSnapshots(
|
48 | 41 | console.log(` - ${target.projectId}:${target.site.firebaseSiteId} | ${target.site.remoteUrl}`);
|
49 | 42 | }
|
50 | 43 |
|
51 |
| - // Clone the docs repo. |
52 |
| - const docsRepoDir = await cloneDocsRepositoryForMajor(major); |
53 |
| - |
54 |
| - // Build the release output. |
55 |
| - const builtPackages = performDefaultSnapshotBuild(); |
56 |
| - |
57 |
| - // Build the docs-content NPM package (not included in the default snapshot build) |
58 |
| - builtPackages.push(buildDocsContentPackage()); |
59 |
| - |
60 |
| - // Install the release output, together with the examples into the |
61 |
| - // the docs repository. |
62 |
| - await installBuiltPackagesInRepo(docsRepoDir, builtPackages); |
63 |
| - |
64 | 44 | // Run the prebuild hook if available.
|
65 |
| - await options.prebuild?.(docsRepoDir); |
| 45 | + await options.prebuild?.(projectDir); |
66 | 46 |
|
67 |
| - // Install yarn dependencies and build the production output. |
68 |
| - // Lockfile freezing needs to be disabled since we updated the `package.json` |
69 |
| - // to point to our locally-built package artifacts. |
70 |
| - await installDepsAndBuildDocsSite(docsRepoDir, {frozenLockfile: false}); |
| 47 | + // Build the production output (we always use HEAD packages). |
| 48 | + await buildDocsSite(); |
71 | 49 |
|
72 | 50 | // Deploy all targets to Firebase.
|
73 | 51 | for (const target of targets) {
|
74 |
| - await deployToSite(docsRepoDir, firebaseServiceKey, target); |
| 52 | + await deployToSite(projectDir, firebaseServiceKey, target); |
75 | 53 | }
|
76 | 54 |
|
77 | 55 | // Run post monitoring tests for production deployments.
|
78 |
| - await runMonitoringTests(docsRepoDir, targets.filter(isProductionDeployment)); |
| 56 | + await runMonitoringTests(targets.filter(isProductionDeployment)); |
79 | 57 | }
|
0 commit comments