简体   繁体   English

部署到 Firebase 托管中的特定目标

[英]Deploying to a specific target in Firebase Hosting

I have the following hosting targets in my firebase.json file我的firebase.json文件中有以下托管目标

{
  "hosting": [
    {
      "target": "staging",
      "public": "build",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    },
    {
      "target": "production",
      "public": "build",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    }
  ]
}

And my firebaserc file contains the following:我的firebaserc文件包含以下内容:

{
  "projects": {
    "default": "project-name177137"
  },
  "targets": {
    "project-name177137": {
      "hosting": {
        "staging": [
          "project-name177137"
        ],
        "production": [
          "productionName"
        ]
      }
    }
  }
}

If I want to deploy to all I usually just do firebase deploy .如果我想部署到所有人,我通常只做firebase deploy

Now imagine I want to deploy to only staging for testing, what firebase command can I use to achieve that?现在想象一下,我只想部署到测试阶段,我可以使用什么 firebase 命令来实现这一点?

Thank you.谢谢你。

 firebase deploy --only hosting:staging

documentation 文件

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM