[英]How to programatically deploy to Firebase Hosting?
I have configured a project that currently is possible to deploy to Firebase Hosting multi sites by using the Firebase CLI.我已经配置了一个项目,目前可以使用 Firebase CLI 部署到 Firebase 托管多站点。
The problem is that currently I am doing this manually.问题是目前我正在手动执行此操作。 And I want to programatically do this, and if possible, using NodeJS.
我想以编程方式执行此操作,如果可能的话,使用 NodeJS。
firebase hosting:sites:create game-project-id-unique
firebase target:apply hosting game-id game-project-id-unique
{
"target": "game-id",
"public": "games/game-id",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
firebase deploy --only hosting
I have researched here, I have found out that is possible to use the API-DEPLOY or the CLOUD BUILD , but this is not enough to guide me into the programatically approach, without the need of a human in-between.我在这里进行了研究,发现可以使用API-DEPLOY或CLOUD BUILD ,但这不足以指导我采用编程方法,而无需中间人。
Is there a way of doing this?有没有办法做到这一点? Is it even possible?
有可能吗?
You can certainly just write a script that invokes the CLI.您当然可以只编写调用 CLI 的脚本。 This is very common.
这很常见。
You can also use the Firebase Hosting REST API , but in my opinion that is going to be a lot more work.您也可以使用Firebase Hosting REST API ,但我认为这需要做更多的工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.