File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1313 },
1414 "scripts" : {
1515 "start" : " node server/server.js" ,
16- "system-test" : " c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit" ,
17- "system-test-unix" : " c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit" ,
18- "test" : " test/proxy-setup.sh && npm run system-test && npm run system-test-unix"
16+ "system-test" : " test/proxy-setup.sh tcp && c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit" ,
17+ "system-test-unix" : " test/proxy-setup.sh socket && c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit" ,
18+ "test" : " npm run system-test && npm run system-test-unix"
1919 },
2020 "dependencies" : {
2121 "@google-cloud/functions-framework" : " ^3.0.0" ,
Original file line number Diff line number Diff line change 1515# Proof of concept: setting up proxy
1616
1717PROXY_VERSION=" v2.15.1"
18+ SETUP_STYLE=${1:- tcp}
19+
20+ if [ $SETUP_STYLE -ne " tcp" ]; then
21+ mkdir cloudsql && chmod 777 cloudsql
22+ socket=" --unix-socket /cloudsql"
23+ ; fi
1824
1925curl -o cloud-sql-proxy https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/${PROXY_VERSION} /cloud-sql-proxy.linux.amd64
2026if [ $? -ne 0 ]; then
2127 echo " Failed to download cloud-sql-proxy"
2228 exit 1
2329fi
2430chmod +x cloud-sql-proxy
25- ./cloud-sql-proxy $CLOUD_SQL_CONNECTION_NAME &
31+ ./cloud-sql-proxy $CLOUD_SQL_CONNECTION_NAME $socket &
2632sleep 10
You can’t perform that action at this time.
0 commit comments