File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 3636PROXY_VERSION=" v2.15.1"
3737SOCKET=${SOCKET:- tcp}
3838
39+ echop (){
40+ echo " \033[0;35m $1 \033[0m"
41+ }
42+
43+
3944if [[ $SOCKET == " unix" ]]; then
4045 UNIX_SOCKET_DIR=${UNIX_SOCKET_DIR:- " tmp/cloudsql" }
4146 mkdir -p $UNIX_SOCKET_DIR && chmod 777 $UNIX_SOCKET_DIR
4247 socket=" --unix-socket $UNIX_SOCKET_DIR "
4348fi
44- echo " Setting up cloud-sql-proxy for $SOCKET socket connections"
49+ echop " Setting up cloud-sql-proxy for $SOCKET socket connections"
4550
4651# Download the Cloud SQL Auth Proxy (only once)
4752if [[ ! -f cloud-sql-proxy ]]; then
5863# Setup proxy
5964./cloud-sql-proxy $socket $CLOUD_SQL_CONNECTION_NAME &
6065sleep 5
61- echo " Proxy ready for use"
66+ echop " Proxy ready for use"
6267
6368# Run whatever command was passed to this script
6469$@ || STATUS=$?
6570
6671# Cleanup
67- echo " Shutting down proxy process"
72+ echop " Shutting down proxy process"
6873pkill -f " cloud-sql-proxy" || echo " cloud-sql-proxy process not found. Was it already stopped?"
6974
7075# Fail if the tests failed
Original file line number Diff line number Diff line change 22 "env" : {
33 "INSTANCE_HOST" : " 127.0.0.1" ,
44 "INSTANCE_CONNECTION_NAME" : " nodejs-docs-samples-tests:us-central1:mysql-ci" ,
5- "CLOUD_SQL_CONNECTION_NAME" : " $INSTANCE_CONNECTION_NAME" ,
65 "UNIX_SOCKET_DIR" : " tmp/cloudsql" ,
6+ "CLOUD_SQL_CONNECTION_NAME" : " $INSTANCE_CONNECTION_NAME" ,
77 "INSTANCE_UNIX_SOCKET" : " $UNIX_SOCKET_DIR/$INSTANCE_CONNECTION_NAME" ,
88 "DB_NAME" : " kokoro_ci" ,
99 "DB_USER" : " kokoro_ci"
You can’t perform that action at this time.
0 commit comments