firebase 部署:如何修改预部署
firebase deploy: how to modify pre-deploy
我在 firebase 托管上有一个带有 javascript 运行ning 的小型前端项目,我必须在每次 运行 [=10= 之前手动调用构建脚本].所以我一直在寻找一种将其放入预部署脚本的方法,但 firebase CLI 文档中没有这样的东西。
那么有人知道如何完成吗?
有 documentation 用于 Firebase CLI 的预部署挂钩。
For any of the assets you can deploy—hosting, functions, database, storage, and firestore— you can add predeploy and postdeploy hooks in firebase.json, and your scripts will run with the corresponding deployment command. Both predeploy and postdeploy hooks print the standard output and error streams of the scripts to the terminal.
例如:
{
"hosting":{
"postdeploy":"./messageSlack.sh 'Just deployed to Firebase Hosting'",
"public":"public"
}
}
预部署支持最新的 Firebase CLI,请更新您的 CLI 并在 firebase.json
文件中创建 predeploy
。
"hosting": {
"predeploy": "npm run build",
"public": "build",
我在 firebase 托管上有一个带有 javascript 运行ning 的小型前端项目,我必须在每次 运行 [=10= 之前手动调用构建脚本].所以我一直在寻找一种将其放入预部署脚本的方法,但 firebase CLI 文档中没有这样的东西。 那么有人知道如何完成吗?
有 documentation 用于 Firebase CLI 的预部署挂钩。
For any of the assets you can deploy—hosting, functions, database, storage, and firestore— you can add predeploy and postdeploy hooks in firebase.json, and your scripts will run with the corresponding deployment command. Both predeploy and postdeploy hooks print the standard output and error streams of the scripts to the terminal.
例如:
{
"hosting":{
"postdeploy":"./messageSlack.sh 'Just deployed to Firebase Hosting'",
"public":"public"
}
}
预部署支持最新的 Firebase CLI,请更新您的 CLI 并在 firebase.json
文件中创建 predeploy
。
"hosting": {
"predeploy": "npm run build",
"public": "build",