Firebase-tools: 托管:频道:部署:托管配置应仅包含“站点”或“目标”,而不是两者。

创建于 2020-10-27  ·  3评论  ·  资料来源: firebase/firebase-tools

我有一个带有目标的多站点配置。 使用npx firebase-tools deploy --only hostingnpx firebase-tools deploy --only hosting:bbbb可以正常工作。 但是如果我使用新的 GitHub 操作,它就失败了:

 /usr/local/bin/npx firebase-tools hosting:channel:deploy pr22-blah --expires 30d --project blah-dev --json

在本地运行相同的东西以相同的方式失败。 错误是:

$ npx firebase-tools hosting:channel:deploy pr22-blah --only bbb --expires 30d --project blah-dev --json
{
  "status": "error",
  "error": "Hosting configs should only include either \"site\" or \"target\", not both."
}

请注意,我在那里使用的命令添加了--only bbb 。 无论有没有,该命令都会以相同的方式失败。

另请注意,我的firebase.json根本没有列出"site" 。 见下文:

.firebaserc:

{
  "projects": {
    "default": "blah-dev",
    "dev": "blah-dev",
    "prod": "blah-io"
  },
  "targets": {
    "blah-io": {
      "hosting": {
        "aaa": [
          "blah-aaa"
        ],
        "boilerplate": [
          "blah-boilerplate"
        ],
        "bbb": [
          "blah-bingo"
        ]
      }
    },
    "blah-dev": {
      "hosting": {
        "aaa": [
          "blah-aaa-dev"
        ],
        "boilerplate": [
          "blah-boilerplate-dev"
        ],
        "bbb": [
          "blah-bbb-dev"
        ]
      }
    }
  }
}

firebase.json

{
  "firestore": {...},
  "database": {...},
  "functions": {...},
  "hosting": [
    {
      "target": "aaa",
      "public": "packages/aaa/build",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    },
    {
      "target": "boilerplate",
      "public": "packages/boilerplate/build",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    },
    {
      "target": "bbb",
      "public": "packages/bbb/build",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    }
  ],
  "emulators": {...}
}

[必需] 环境信息

火力基地工具:npx firebase-tools --version -> 8.14.0

平台: OSX,还有 GitHub Actions 默认镜像

[必需] 测试用例

往上看。

[必需] 重现步骤

往上看。 运行hosts:channel :deploy 命令

[必需] 预期行为

它部署

[必需] 实际行为

{
  "status": "error",
  "error": "Hosting configs should only include either \"site\" or \"target\", not both."
}

--debug标志在前面添加了很多 HTTP 日志记录噪音,但都是 200 秒。)

最有用的评论

感谢您的报告。 我已经解决了,会尽快解决。

所有3条评论

感谢您的报告。 我已经解决了,会尽快解决。

我在不使用频道而只使用 firebase deploy --only 托管时收到此错误:. 我在 gitlab runner 上运行它,我有站点和分支名称的目标
firebase deploy --only hosting:$CI_COMMIT_REF_SLUG -m "Tag $TAG Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive

@Mistic92请打开一个包含更多详细信息和复制步骤的新问题。

此页面是否有帮助?
0 / 5 - 0 等级