Firebase-tools: Firebase-cli์—๋Š” ๋กœ์ปฌ ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์ œํ’ˆ๊ตฐ์ด ์—†์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2020๋…„ 06์›” 11์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: firebase/firebase-tools

์‚ญ์ œํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค. validate_template=true template_path=.github/ISSUE_TEMPLATE/bug_report.md Firebase ์ปค๋ฎค๋‹ˆํ‹ฐ์— ๊ธฐ์—ฌํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! md5-4f584446c02c091fc1cc63786b0a4438 ์˜ˆ, ์šฐ๋ฆฌ๋Š” ํ™•์‹คํžˆ ์™„๋ฒฝํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค! ์ด ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜๊ณ  ๋ฌธ์ œ๋ฅผ ์—ด โ€‹โ€‹๋•Œ ์ตœ์†Œํ•œ์˜ ์žฌํ˜„์„ ํฌํ•จํ•˜์‹ญ์‹œ์˜ค. ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ๊ณ  ๊ณ„์‹œ๋‹ค๋ฉด ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•ด ์ฃผ์‹œ๋ฉด ๊ธฐ๊บผ์ด ๊ฒ€ํ† ํ•ด ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค! md5-05a0c106e15ca89a73bafbf6cfe51156 ์ข‹์Šต๋‹ˆ๋‹ค. ์ œํ’ˆ์„ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ๋“ฃ๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค! ๊ทธ๋Ÿฌ๋‚˜ ์ด ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ธฐ๋Šฅ ์š”์ฒญ์„ ์ œ์ถœํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค. ๊ธฐ๋Šฅ ์š”์ฒญ์„ ๋‹ค์Œ ์ฃผ์†Œ๋กœ ์ œ์ถœํ•ด ์ฃผ์‹ญ์‹œ์˜ค. https://firebase.google.com/support/contact/bugs-features/ md5-8fad5406b734ff6789bcdb94f25799b4 ์šฐ๋ฆฌ๋Š” ๋งŽ์€ ๊ฒƒ์„ ๋ฐ›๊ณ  ์žˆ๊ณ  ๋‹น์‹ ์„ ๋•๊ณ  ์‹ถ์ง€๋งŒ GitHub๋Š” ๊ทธ๋“ค์—๊ฒŒ ์ตœ์ ์˜ ์žฅ์†Œ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. ํ์‡„๋ฉ๋‹ˆ๋‹ค. ๋จผ์ € ๊ฐ€์ด๋“œ๋ฅผ ์‚ดํŽด๋ณด์„ธ์š”. https://firebase.google.com/docs/cli/ ๊ณต์‹ ๋ฌธ์„œ๊ฐ€ ๋„์›€์ด ๋˜์ง€ ์•Š์œผ๋ฉด ๊ณต์‹ ์ง€์› ์ฑ„๋„(https://firebase.google.com/)์„ ํ†ตํ•ด ๋ฌธ์˜ํ•ด ๋ณด์„ธ์š”. support/ ์ปค๋ฎค๋‹ˆํ‹ฐ์˜ ์†”๋ฃจ์…˜์ด๋‚˜ ์ง€์›์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ์ถ”๊ฐ€ ์œ„์น˜: - Stack Overflow: https://stackoverflow.com/ - Firebase Slack ์ปค๋ฎค๋‹ˆํ‹ฐ: https://firebase.community/ *์—ฌ๋Ÿฌ ์ฑ„๋„์— ์ค‘๋ณต ๊ฒŒ์‹œ๋ฅผ ๋ฐฉ์ง€ํ•˜์„ธ์š”!*

[ํ•„์ˆ˜] ํ™˜๊ฒฝ ์ •๋ณด

์–ด๋–ค ๋ฒ„์ „์˜ Firebase CLI(`firebase-tools`)๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๊นŒ? ์ตœ์‹  ๋ฒ„์ „์—์„œ ๋ฌธ์ œ๊ฐ€ ์ด๋ฏธ ์ˆ˜์ •๋˜์—ˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ตœ์‹  ๋ฒ„์ „์€ https://github.com/firebase/firebase-tools/releases์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Firebase ๋„๊ตฌ: 8.2.0

ํ”Œ๋žซํผ: Linux ๋ฐ๋น„์•ˆ 4.9.0-12-amd64

[ํ•„์ˆ˜] ์žฌํ˜„ ๋‹จ๊ณ„

~$ firebase init emulators -y

๊ทธ๋Ÿฐ ๋‹ค์Œ 4000 ํฌํŠธ์— ์—ฐ๊ฒฐ๋œ firebase.json ์— UI ํ–‰์„ ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค.
๊ด€๋ จ ๋ฌธ์ œ: https://github.com/firebase/firebase-tools/issues/2332

"ui": {
      "enabled": true,      // Default is `true`
      "host": "localhost",
      "port": 4000          // If unspecified, see CLI log for selected port
    },

Firebase ๊ณต์‹ ๋ฌธ์„œ: https://firebase.google.com/docs/emulator-suite/install_and_configure#configure_emulator_suite

๊ทธ๋Ÿฐ ๋‹ค์Œ ์—๋ฎฌ๋ ˆ์ดํ„ฐ๋ฅผ ์‹œ์ž‘ํ•˜์‹ญ์‹œ์˜ค.

~$ firebase emulators:start

[ํ•„์ˆ˜] ์˜ˆ์ƒ๋˜๋Š” ๋™์ž‘

์˜ˆ์ƒ๋˜๋Š” ๋™์ž‘์€ ๋ฌด์—‡์ž…๋‹ˆ๊นŒ?

UI ๋ชจ๋“œ์—์„œ ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์ œํ’ˆ๊ตฐ์„ ํ‘œ์‹œํ•  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋ฉ๋‹ˆ๋‹ค.

image

[ํ•„์ˆ˜] ์‹ค์ œ ํ–‰๋™

์ฝ˜์†”์—๋Š” Emulators Suite UI๊ฐ€ ์—†์ง€๋งŒ ํ—ˆ๋ธŒ๋งŒ ์žˆ์Šต๋‹ˆ๋‹ค.

image

image

--debug ํ”Œ๋ž˜๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Firebase-cli ๋กœ๊ทธ

--debug ํ”Œ๋ž˜๊ทธ์™€ ํ•จ๊ป˜ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜๊ณ  ์•„๋ž˜ ๋กœ๊ทธ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
$ ./node_modules/.bin/firebase emulators:start --debug
[2020-06-11T17:23:00.445Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2020-06-11T17:23:00.446Z] > authorizing via signed-in user
i  emulators: Starting emulators: functions, firestore, hosting
[2020-06-11T17:23:00.497Z] [hub] writing locator at /tmp/hub-medina-app-staging-67303.json
โœ”  hub: emulator hub started at http://localhost:4400
โœ”  functions: Using node<strong i="23">@10</strong> from host.
โœ”  functions: functions emulator started at http://localhost:5001
[2020-06-11T17:23:00.917Z] Ignoring unsupported arg: projectId
[2020-06-11T17:23:00.918Z] Ignoring unsupported arg: auto_download
[2020-06-11T17:23:00.918Z] Starting firestore emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/home/paneladm/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.3.jar","--host","localhost","--port",8080,"--rules","/home/paneladm/projects/paneladm-dev/medina-app/firestore.rules","--functions_emulator","localhost:5001"],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator","seed_from_export"],"joinArgs":false}
i  firestore: firestore emulator logging to firestore-debug.log

i  firestore: firestore emulator logging to firestore-debug.log
[2020-06-11T17:23:02.124Z] API endpoint: http://localhost
[2020-06-11T17:23:02.125Z] :8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=localhost:8080

Dev App Server is now running.


โœ”  firestore: firestore emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
[2020-06-11T17:23:02.194Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/medina-app-staging-67303/webApps/-/config  

[2020-06-11T17:23:03.196Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Thu, 11 Jun 2020 17:23:02 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
i  hosting[default]: Serving hosting files from: dist/public
โœ”  hosting[default]: Local server: http://localhost:5000
i  hosting[staging]: Serving hosting files from: dist/public
โœ”  hosting[staging]: Local server: http://localhost:5005
โœ”  hosting: hosting emulator started at http://localhost:5000
i  functions: Watching "/home/paneladm/projects/paneladm-dev/medina-app/dist/functions" for Cloud Functions...
[2020-06-11T17:23:03.278Z] [worker-pool] addWorker(~diagnostic~) 
[2020-06-11T17:23:03.279Z] [worker-pool] Adding worker with key ~diagnostic~, total=1 
[2020-06-11T17:23:03.279Z] [worker-pool] submitWork(triggerId=) 
[2020-06-11T17:23:03.280Z] [worker-~diagnostic~-097da58f-0d5d-4c2e-bbce-a4099abeb9db]: Assigning socketPath: /tmp/fire_emu_8048.sock 
[2020-06-11T17:23:03.280Z] [worker-~diagnostic~-097da58f-0d5d-4c2e-bbce-a4099abeb9db]: BUSY 
[2020-06-11T17:23:03.674Z] [runtime-status] [8048] Functions runtime initialized. {"cwd":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions","node_version":"10.20.1"} 
[2020-06-11T17:23:03.675Z] [runtime-status] [8048] Disabled runtime features: undefined 
[2020-06-11T17:23:03.678Z] [runtime-status] [8048] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.11.0","resolution":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions/node_modules/firebase-admin/lib/index.js"} 
[2020-06-11T17:23:03.679Z] [runtime-status] [8048] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.1","resolution":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions/node_modules/firebase-functions/lib/index.js"} 
[2020-06-11T17:23:03.683Z] [runtime-status] [8048] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] 
[2020-06-11T17:23:03.723Z] [runtime-status] [8048] Checked functions.config() {"config":{}} 
[2020-06-11T17:23:03.724Z] [runtime-status] [8048] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.1","resolution":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions/node_modules/firebase-functions/lib/index.js"} 
[2020-06-11T17:23:03.725Z] [runtime-status] [8048] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.11.0","resolution":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions/node_modules/firebase-admin/lib/index.js"} 
[2020-06-11T17:23:03.726Z] [runtime-status] [8048] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.1","resolution":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions/node_modules/firebase-functions/lib/index.js"} 
[2020-06-11T17:23:03.726Z] [runtime-status] [8048] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"8.11.0","resolution":"/home/paneladm/projects/paneladm-dev/medina-app/dist/functions/node_modules/firebase-admin/lib/index.js"}} 
[2020-06-11T17:23:03.820Z] [runtime-status] [8048] initializeApp(DEFAULT) {"databaseURL":"https://medina-app-staging-67303.firebaseio.com","storageBucket":"medina-app-staging-67303.appspot.com","projectId":"medina-app-staging-67303"} 
[2020-06-11T17:23:03.830Z] addFirestoreTrigger "{\"eventTrigger\":{\"resource\":\"projects/medina-app-staging-67303/databases/(default)/documents/messages/{documentId}\",\"eventType\":\"providers/cloud.firestore/eventTypes/document.create\",\"service\":\"firestore.googleapis.com\"}}"
[2020-06-11T17:23:03.831Z] >>> HTTP REQUEST PUT http://localhost:8080/emulator/v1/projects/medina-app-staging-67303/triggers/makeUppercase  
 {"eventTrigger":{"resource":"projects/medina-app-staging-67303/databases/(default)/documents/messages/{documentId}","eventType":"providers/cloud.firestore/eventTypes/document.create","service":"firestore.googleapis.com"}}
[2020-06-11T17:23:03.832Z] [worker-~diagnostic~-097da58f-0d5d-4c2e-bbce-a4099abeb9db]: IDLE 
[2020-06-11T17:23:03.882Z] Jun 11, 2020 2:23:03 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.

[2020-06-11T17:23:04.077Z] Jun 11, 2020 2:23:04 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.

[2020-06-11T17:23:04.918Z] <<< HTTP RESPONSE 200 {"content-type":"application/json","content-length":"4"}
[2020-06-11T17:23:04.919Z] addFirestoreTrigger "{\"eventTrigger\":{\"resource\":\"projects/medina-app-staging-67303/databases/(default)/documents/customers/{customerId}\",\"eventType\":\"providers/cloud.firestore/eventTypes/document.create\",\"service\":\"firestore.googleapis.com\"}}"
[2020-06-11T17:23:04.919Z] >>> HTTP REQUEST PUT http://localhost:8080/emulator/v1/projects/medina-app-staging-67303/triggers/onCustomerCreated  
 {"eventTrigger":{"resource":"projects/medina-app-staging-67303/databases/(default)/documents/customers/{customerId}","eventType":"providers/cloud.firestore/eventTypes/document.create","service":"firestore.googleapis.com"}}
[2020-06-11T17:23:04.931Z] Jun 11, 2020 2:23:04 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.

[2020-06-11T17:23:04.958Z] <<< HTTP RESPONSE 200 {"content-type":"application/json","content-length":"4"}
โœ”  functions[nextApp]: http function initialized (http://localhost:5001/medina-app-staging-67303/us-central1/nextApp).
โœ”  functions[addMessage]: http function initialized (http://localhost:5001/medina-app-staging-67303/us-central1/addMessage).
โœ”  functions[makeUppercase]: firestore function initialized.
โœ”  functions[onCustomerCreated]: firestore function initialized.
โœ”  functions[getSearchKey]: http function initialized (http://localhost:5001/medina-app-staging-67303/us-central1/getSearchKey).
โœ”  emulators: All emulators started, it is now safe to connect.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

@francisrod01 ๋„ค ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์ œํ’ˆ๊ตฐ์ด 8.4์—์„œ ์ถœ์‹œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!

๋ชจ๋“  3 ๋Œ“๊ธ€

์ด ๋ฌธ์ œ๋Š” ๋ฌธ์ œ ํ…œํ”Œ๋ฆฟ์„ ๋”ฐ๋ฅด์ง€ ์•Š๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ•„์š”ํ•œ ๋ชจ๋“  ์ •๋ณด๋ฅผ ์ œ๊ณตํ–ˆ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.

์ž ์‹œ ๋™์•ˆ ์ธํ„ฐ๋„ท ๊ฒ€์ƒ‰์„ ํ†ตํ•ด ๋ฌธ์„œ์— ์„ค๋ช…๋˜์ง€ ์•Š์€ ์†”๋ฃจ์…˜์„ ์ฐพ์•˜์Šต๋‹ˆ๋‹ค. https://github.com/firebase/firebase-tools/issues/2272#issuecomment -636464586

8.4.* firebase-tools ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜๋ฉด ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

image

๋ฌธ์„œ ์—…๋ฐ์ดํŠธ

๋ˆ„๊ตฐ๊ฐ€ ๋ฌธ์„œ์—์„œ ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์„น์…˜์„ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

@francisrod01 ๋„ค ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์ œํ’ˆ๊ตฐ์ด 8.4์—์„œ ์ถœ์‹œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰