简体   繁体   English

firebase 部署:如何修改预部署

[英]firebase deploy: how to modify pre-deploy

I have a small front-end project with javascript running on firebase hosting and I have to call the build script manually before every time I run firebase deploy .我有一个在 firebase 托管上运行 javascript 的小型前端项目,每次运行firebase deploy之前我都必须手动调用构建脚本。 So I was looking for a way to put it in a pre-deploy script but there's no such thing in firebase CLI documentation.所以我一直在寻找一种将其放入预部署脚本的方法,但 firebase CLI 文档中没有这样的东西。 So anyone has any idea how to make it done?那么有人知道如何完成吗?

Predeploy supports in latest Firebase CLI, please update your CLI and create predeploy in firebase.json file.预部署支持最新的 Firebase CLI,请更新您的 CLI 并在firebase.json文件中创建predeploy

"hosting": {
  "predeploy": "npm run build",
  "public": "build",

There is documentation for predeploy hooks with the Firebase CLI.有关于使用 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.对于您可以部署的任何资产(托管、函数、数据库、存储和 firestore),您可以在 firebase.json 中添加部署前和部署后挂钩,您的脚本将使用相应的部署命令运行。 Both predeploy and postdeploy hooks print the standard output and error streams of the scripts to the terminal. predeploy 和 postdeploy 挂钩都将脚本的标准输出和错误流打印到终端。

For example:例如:

 {
   "hosting":{
     "postdeploy":"./messageSlack.sh 'Just deployed to Firebase Hosting'",
     "public":"public"
   }
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用firebase托管自由部署项目 - How to freely deploy project using firebase hosting 如何将 Firebase 存储规则部署到特定的存储桶? - How to deploy Firebase Storage rules to specific buckets? Kahoot 克隆部署在 FireBase - Kahoot Clone Deploy on FireBase Firebase CLI 不工作(firebase 部署) - Firebase CLI not working (firebase deploy) Firebase 部署链接显示空白或部署完成 - Firebase Deploy Link shows Blank or Deploy complete 使用“firebase deploy”部署到托管 - firebase 如何知道它是部署到托管而不是云功能? - using "firebase deploy" to deploy to hosting - how does firebase know if it is deploying to hosting and not cloud functions? 如何在没有 npm 依赖冲突的情况下部署到 firebase 函数? - How do I deploy to firebase functions without npm dependency conflict? Firebase Hosting,如何一次在多个账户部署相同的代码 - Firebase Hosting, how to deploy the same code on more account at once 如何将 firebase function 部署为“NODE_ENV = development” - How can I deploy firebase function as 'NODE_ENV = development' 如何在 firebase 中部署增量 Static 再生? 我超级菜鸟和沮丧 - how to deploy Incremental Static Regeneration in firebase ? im super noob and frustated
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM