【问题标题】:Deploying to a specific target in Firebase Hosting在 Firebase 托管中部署到特定目标
【发布时间】:2021-11-20 11:08:28
【问题描述】:

我的 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"
        }
      ]
    }
  ]
}

我的 firebaserc 文件包含以下内容:

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

如果我想部署到所有人,我通常只做firebase deploy。

现在假设我只想部署到 staging 进行测试,我可以使用什么 firebase 命令来实现这一目标?

谢谢。

【问题讨论】:

    标签: json firebase-hosting firebase-cli


    【解决方案1】:

    firebase deploy --only hosting:staging

    documentation

    【讨论】:

    • 是的,它奏效了。谢谢
    猜你喜欢
    • 2022-07-27
    • 2019-09-23
    • 1970-01-01
    • 2017-08-14
    • 1970-01-01
    • 2021-01-06
    • 2015-04-18
    • 2020-01-14
    • 2020-02-27
    相关资源
    最近更新 更多