8000 ci: fix AIO deployment to multiple Firebase sites (#39948) · angular/angular@1676d22 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1676d22

Browse files
gkalpakmhevery
authored andcommitted
ci: fix AIO deployment to multiple Firebase sites (#39948)
Since #39853, it is possible to deploy to multiple Firebase sites from a single branch. In order to deploy to a site, we need to associate an alias (`aio`) with a site. This is done via the `firebase target:apply` command. However, when the command is called multiple times, it associates the alias with many sites, which subsequently fails during deployment ([example failure][1]), since the `firebase deploy` command does not know what site to deploy to. This commit fixes the deployment script by ensuring that any previous association with the `aio` alias is cleared (via the `firebase target:clear` command) before associating it with a new site. [1]: https://circleci.com/gh/angular/angular/871020 PR Close #39948
1 parent 6628f25 commit 1676d22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

aio/scripts/deploy-to-firebase.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ function deploy(data) {
250250
preDeployActions.forEach(fn => fn(data));
251251

252252
console.log('\n\n\n==== Deploy AIO to Firebase hosting. ====\n');
253-
yarn(`firebase use "${projectId}" --token "${firebaseToken}"`);
254-
yarn(`firebase target:apply hosting aio "${siteId}" --token "${firebaseToken}"`);
255-
yarn(
256-
`firebase deploy --only hosting:aio --message "Commit: ${currentCommit}" --non-interactive ` +
257-
`--token "${firebaseToken}"`);
253+
const firebase = cmd => yarn(`firebase ${cmd} --token "${firebaseToken}"`);
254+
firebase(`use "${projectId}"`);
255+
firebase('target:clear hosting aio');
256+
firebase(`target:apply hosting aio "${siteId}"`);
257+
firebase(`deploy --only hosting:aio --message "Commit: ${currentCommit}" --non-interactive`);
258258

259259
console.log('\n\n\n==== Run post-deploy actions. ====\n');
260260
postDeployActions.forEach(fn => fn(data));

0 commit comments

Comments
 (0)
0