build(docs-infra): switch deploy-to-firebase.sh script to JS (#39470)

This commit switches the `deploy-to-firebase.sh` script, that we use for
deploying angular.io to production, from Bash to JavaScript. This makes
the script easier to maintain.

For the same reasons, it also switches the `deploy-to-firebase.test.sh`
script, that we use for testing the `deploy-to-firebase` script, from
Bash to JavaScript (using jasmine as the test runner).

Finally, this commit also updates ShellJS to the latest version to get
better error messages (including the actual error) when `exec()` fails.

NOTE: Before switching the test script to JS, I verified that the new
      `deploy-to-firebase.js` script passed the tests with the old
      `deploy-to-firebase.test.sh` script.

PR Close #39470
This commit is contained in:
George Kalpakas
2020-10-28 12:23:51 +02:00
committed by Joey Perrott
parent 8317042483
commit 5143d52d2b
8 changed files with 368 additions and 383 deletions
+3 -3
View File
@@ -49,7 +49,7 @@
"example-use-local": "node tools/ng-packages-installer overwrite ./tools/examples/shared --debug --force",
"example-use-npm": "node tools/ng-packages-installer restore ./tools/examples/shared",
"example-check-local": "node tools/ng-packages-installer check ./tools/examples/shared",
"deploy-production": "scripts/deploy-to-firebase.sh",
"deploy-production": "node scripts/deploy-to-firebase",
"check-env": "yarn ~~check-env",
"postcheck-env": "yarn aio-check-local",
"payload-size": "scripts/payload.sh",
@@ -62,7 +62,7 @@
"redirects-test": "node tests/deployment/unit/test",
"firebase-utils-test": "node tools/firebase-test-utils/test",
"tools-lint": "tslint --config \"tools/tslint.json\" --project \"tools/firebase-test-utils\"",
"tools-test": "./scripts/deploy-to-firebase.test.sh && yarn docs-test && yarn boilerplate:test && jasmine tools/ng-packages-installer/index.spec.js && yarn firebase-utils-test",
"tools-test": "yarn docs-test && yarn boilerplate:test && jasmine tools/ng-packages-installer/index.spec.js && jasmine scripts/deploy-to-firebase.spec.js && yarn firebase-utils-test",
"preserve-and-sync": "yarn docs",
"serve-and-sync": "run-p \"docs-watch --watch-only\" \"start {@}\" --",
"boilerplate:add": "node ./tools/examples/example-boilerplate add",
@@ -161,7 +161,7 @@
"remark-html": "^8.0.0",
"rimraf": "^2.6.1",
"semver": "^5.3.0",
"shelljs": "^0.7.7",
"shelljs": "^0.8.4",
"tree-kill": "^1.1.0",
"ts-node": "^8.4.1",
"tslint": "~6.1.0",