๋์์ด ์๋ ๋ค์ค ์ฌ์ดํธ ๊ตฌ์ฑ์ด ์์ต๋๋ค. npx firebase-tools deploy --only hosting
๋๋ npx 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": {...}
}
Firebase ๋๊ตฌ: . npx firebase-tools --version
-> 8.14.0
ํ๋ซํผ: OSX, GitHub Actions ๊ธฐ๋ณธ ์ด๋ฏธ์ง
์ ์ฐธ์กฐ.
์ ์ฐธ์กฐ. ํธ์คํ :์ฑ๋ :๋ฐฐํฌ ๋ช ๋ น์ ์คํํฉ๋๋ค
๋ฐฐํฌ
{
"status": "error",
"error": "Hosting configs should only include either \"site\" or \"target\", not both."
}
( --debug
ํ๋๊ทธ๋ ์ ๋ฉด์ ๋ง์ HTTP ๋ก๊น
๋
ธ์ด์ฆ๋ฅผ ์ถ๊ฐํ์ง๋ง ๋ชจ๋ 200์ด์
๋๋ค.)
์ ๊ณ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์์ ์ฌํญ์ด ์์ด ์ต๋ํ ๋นจ๋ฆฌ ๋ณด๋ด๋๋ฆฌ๊ฒ ์ต๋๋ค.
์ฑ๋์ ์ฌ์ฉํ์ง ์๊ณ Firebase ๋ฐฐํฌ --only ํธ์คํ
๋ง ์ฌ์ฉํ ๋ ์ด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
firebase deploy --only hosting:$CI_COMMIT_REF_SLUG -m "Tag $TAG Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive
@Mistic92 ์์ธํ ๋ด์ฉ๊ณผ ์ฌ์์ฐ ๋จ๊ณ๊ฐ ํฌํจ๋ ์ ๋ฌธ์ ๋ฅผ ์ด์ด์ฃผ์ธ์.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ ๊ณ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์์ ์ฌํญ์ด ์์ด ์ต๋ํ ๋นจ๋ฆฌ ๋ณด๋ด๋๋ฆฌ๊ฒ ์ต๋๋ค.