-
Notifications
You must be signed in to change notification settings - Fork 2
/
package.json
46 lines (46 loc) · 3.35 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"name": "willow",
"author": {
"name": "Pedro Henrique",
"email": "[email protected]"
},
"license": "MIT",
"devDependencies": {
"firebase-tools": "8.5.0"
},
"scripts": {
"login": "firebase login --reauth",
"init": "firebase init",
"//0": "",
"////////// required environment variables used in some commands": "",
"require:google_application_credentials": "[ \"${GOOGLE_APPLICATION_CREDENTIALS}\" ] || { echo 'GOOGLE_APPLICATION_CREDENTIALS not set (full path to service account key.json file)' ; exit 1 ; }",
"require:function_region": "[ \"${FUNCTION_REGION}\" ] || { echo 'firebase function region not set (us-east1, us-central1, etc)' ; exit 1 ; }",
"require:get_languages": "[ \"${GET_LANGUAGES}\" ] || { echo 'GET_LANGUAGES variable not set (url of get languages function)' ; exit 1 ; }",
"require:set_languages": "[ \"${SET_LANGUAGES}\" ] || { echo 'SET_LANGUAGES variable not set (url of set languages function)' ; exit 1 ; }",
"require:tracer_urls": "[ \"${TRACER_URLS}\" ] || { echo 'TRACER_URLS not set' ; exit 1 ; }",
"//1": "",
"////////// tracer commands for local testing and deployment": "",
"tracers:java:start": "cd ./tracers/java && make emulator",
"tracers:python:start": "cd ./tracers/python && make emulator",
"tracers:java:deploy": "cd ./tracers/java && make deploy",
"tracers:python:deploy": "cd ./tracers/python && make deploy",
"//2": "",
"////////// emulator commands for local testing (hosting emulation requires pre-built client)": "",
"emulator:functions": "npm run require:google_application_credentials && echo 'THIS EMULATOR WILL ACCESS PRODUCTION (firestore)!' && firebase emulators:start --only functions",
"emulator:hosting": "npm run require:google_application_credentials && echo 'THIS EMULATOR WILL ACCESS PRODUCTION! (firestore, functions)' && firebase emulators:start --only hosting",
"emulator:fire_func": "firebase emulators:start --only firestore,functions",
"emulator:func_host": "npm run require:google_application_credentials && echo 'THIS EMULATOR WILL ACCESS PRODUCTION (firestore)!' && firebase emulators:start --only functions,hosting",
"emulator:all": "firebase emulators:start",
"//3": "",
"////////// firebase deployment commands (hosting deployment requires pre-built client)": "",
"deploy:firestore": "firebase deploy --only firestore",
"deploy:functions": "npm run require:function_region && firebase deploy --only firestore,functions",
"deploy:hosting": "firebase deploy --only hosting",
"deploy:all": "npm run require:function_region && firebase deploy",
"//4": "",
"////////// utility commands for calling functions from emulators or deployed": "",
"functions:get_languages": "npm run require:get_languages && curl \"${GET_LANGUAGES}\"",
"functions:set_languages": "npm run require:set_languages && npm run require:tracer_urls && curl -X POST -H 'Content-Type:application/json' --data \"${TRACER_URLS}\" \"${SET_LANGUAGES}\"",
"functions:set_languages:locals": "npm run require:set_languages && curl -X POST -H 'Content-Type:application/json' --data '{\"java\":\"http://localhost:8080\",\"python\":\"http://localhost:8081\"}' \"${SET_LANGUAGES}\""
}
}