|
1 | 1 | #!/bin/bash |
2 | | -echo "#### Building SDK..." && |
3 | | -(cd ../ && rm firebase-functions-*.tgz && npm run build:pack && |
4 | | -mv firebase-functions-*.tgz integration_test/functions/firebase-functions.tgz) && |
5 | | -echo "#### Installing dependencies..." && |
6 | | -(cd functions && npm install) && |
7 | | -echo "##### Deploying empty index.js to project..." && |
8 | | -./functions/node_modules/.bin/tsc -p functions/ && # Make sure the functions/lib directory actually exists. |
9 | | -echo "" > functions/lib/index.js && |
10 | | -firebase deploy --debug 2> ./deploy-debug.log && |
11 | | -echo && |
12 | | -echo "##### Project emptied. Deploying functions..." && |
13 | | -./functions/node_modules/.bin/tsc -p functions/ && |
14 | | -firebase deploy --only functions --debug 2> ./deploy-debug.log && |
15 | | -echo && |
16 | | -echo "##### Please click the 'integrationTests' link above!" && |
17 | | -read -n1 -r -p "##### Press [return] when you've confirmed the tests have passed." && |
18 | | -echo "##### Re-deploying the same functions, to make sure updates work..." && |
19 | | -firebase deploy --only functions --debug 2> ./deploy-debug.log && |
20 | | -echo && |
21 | | -echo "##### Please click the 'integrationTests' link above!" && |
22 | | -read -n1 -r -p "##### Press [return] when you've confirmed the tests have passed." && |
23 | | -echo "##### Removing all functions" && |
24 | | -echo "" > functions/lib/index.js && |
25 | | -firebase deploy --debug 2> ./deploy-debug.log && |
26 | | -rm functions/firebase-functions.tgz |
27 | | -echo && |
28 | | -echo "##### Done! Please verify that your project is empty." |
| 2 | +( |
| 3 | + echo "##### Building SDK..." && |
| 4 | + ( |
| 5 | + cd ../ && |
| 6 | + rm -f firebase-functions-*.tgz && |
| 7 | + npm run build:pack && |
| 8 | + mv firebase-functions-*.tgz integration_test/functions/firebase-functions.tgz |
| 9 | + ) && |
| 10 | + echo "##### Installing dependencies..." && |
| 11 | + ( |
| 12 | + cd functions && |
| 13 | + npm install |
| 14 | + ) && |
| 15 | + echo "##### Deploying empty index.js to project..." && |
| 16 | + ./functions/node_modules/.bin/tsc -p functions/ && # Make sure the functions/lib directory actually exists. |
| 17 | + echo "" > functions/lib/index.js && |
| 18 | + firebase deploy --only functions --debug 2> /dev/null && |
| 19 | + echo && |
| 20 | + echo "##### Project emptied. Deploying functions..." && |
| 21 | + ./functions/node_modules/.bin/tsc -p functions/ && |
| 22 | + firebase deploy --only functions --debug 2> /dev/null && |
| 23 | + echo && |
| 24 | + echo "##### Running the integration tests..." && |
| 25 | + funcURL=$(tail -n 1 firebase-debug.log | awk '{ print $5 }') && # URL is printed on last line of log. |
| 26 | + wget --content-on-error -qO- $funcURL && |
| 27 | + echo && |
| 28 | + echo "##### Integration test run passed!" && |
| 29 | + echo "##### Re-deploying the same functions, to make sure updates work..." && |
| 30 | + firebase deploy --only functions --debug 2> /dev/null && |
| 31 | + echo && |
| 32 | + echo "##### Running the integration tests..." && |
| 33 | + wget --content-on-error -qO- $funcURL && |
| 34 | + echo && |
| 35 | + echo "##### Integration test run passed!" && |
| 36 | + echo "##### Removing all functions" && |
| 37 | + echo "" > functions/lib/index.js && |
| 38 | + firebase deploy --only functions --debug 2> /dev/null && |
| 39 | + rm functions/firebase-functions.tgz && |
| 40 | + rm functions/firebase-debug.log && |
| 41 | + echo && |
| 42 | + echo "##### All tests pass!" |
| 43 | +) || ( |
| 44 | + echo && |
| 45 | + echo "XXXXX Something failed XXXXX" && |
| 46 | + false # Finish with an error code. |
| 47 | +) |
0 commit comments