Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hosting:channel:deploy: Hosting configs should only include either "site" or \"target\", not both. #2746

Closed
adam-remotesocial opened this issue Oct 27, 2020 · 3 comments · Fixed by #2748
Assignees

Comments

@adam-remotesocial
Copy link
Contributor

I have a multisite config with targets. Using npx firebase-tools deploy --only hosting or npx firebase-tools deploy --only hosting:bbbb works fine. But if I use the new GitHub action, it fails on the line:

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

Running the same thing locally fails in the same way. The error is:

$ 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."
}

Note that the command I used there adds --only bbb. The command fails the same way with or without that.

Also note that my firebase.json does NOT list "site" at all. See below:

.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": {...}
}

[REQUIRED] Environment info

firebase-tools:. npx firebase-tools --version -> 8.14.0

Platform: OSX, but also GitHub Actions default image

[REQUIRED] Test case

See above.

[REQUIRED] Steps to reproduce

See above. Run the hosting:channel:deploy command

[REQUIRED] Expected behavior

It deploys

[REQUIRED] Actual behavior

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

(--debug flag adds a lot of HTTP logging noise at the front, but it's all 200s.)

@bkendall
Copy link
Contributor

Thanks for the report. I've got a fix out and will get it out ASAP.

@Mistic92
Copy link

I'm getting this error when not using channel but just firebase deploy --only hosting:. I'm running it on gitlab runner where I have site and target by branch name
firebase deploy --only hosting:$CI_COMMIT_REF_SLUG -m "Tag $TAG Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive

@bkendall
Copy link
Contributor

@Mistic92 please open a new issue with more details and reproduction steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants