From b9bf03af334f7c67578d1c6a511fc4aad13e65f0 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Thu, 5 Nov 2020 18:26:14 +0200 Subject: [PATCH] build(docs-infra): print the git commit when deploying to Firebase (#39596) The commit updates the AIO deployment script to also print the commit SHA. This makes it easier to check whether a version has been successfully deployed, by comparing the commit SHA from the CI job with the SHA in the version string in the footer of the AIO app. PR Close #39596 --- aio/scripts/deploy-to-firebase.js | 1 + aio/scripts/deploy-to-firebase.spec.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aio/scripts/deploy-to-firebase.js b/aio/scripts/deploy-to-firebase.js index a381a7a592..af327f0a31 100644 --- a/aio/scripts/deploy-to-firebase.js +++ b/aio/scripts/deploy-to-firebase.js @@ -31,6 +31,7 @@ if (require.main === module) { } else { console.log( `Git branch : ${inputVars.currentBranch}\n` + + `Git commit : ${inputVars.currentCommit}\n` + `Build/deploy mode : ${deploymentInfo.deployEnv}\n` + `Firebase project : ${deploymentInfo.projectId}\n` + `Firebase site : ${deploymentInfo.siteId}\n` + diff --git a/aio/scripts/deploy-to-firebase.spec.js b/aio/scripts/deploy-to-firebase.spec.js index 02a09a3aed..696e7c6652 100644 --- a/aio/scripts/deploy-to-firebase.spec.js +++ b/aio/scripts/deploy-to-firebase.spec.js @@ -262,17 +262,19 @@ describe('deploy-to-firebase:', () => { }); it('integration - should run the main script without error', () => { + const commit = getLatestCommit('master'); const cmd = `"${process.execPath}" "${__dirname}/deploy-to-firebase" --dry-run`; const env = { CI_REPO_OWNER: 'angular', CI_REPO_NAME: 'angular', CI_PULL_REQUEST: 'false', CI_BRANCH: 'master', - CI_COMMIT: getLatestCommit('master') + CI_COMMIT: commit, }; const result = execSync(cmd, {encoding: 'utf8', env}).trim(); expect(result).toBe( 'Git branch : master\n' + + `Git commit : ${commit}\n` + 'Build/deploy mode : next\n' + 'Firebase project : angular-io\n' + 'Firebase site : next-angular-io-site\n' +