1919# server is already running (it will just be a no-op).
2020
2121set -euo pipefail
22- set -xv
22+
23+ function run_command {
24+ echo " $* "
25+ " $@ "
26+ }
2327
2428# Determine the absolute path of the directory containing this file.
2529readonly SCRIPT_DIR=" $( readlink -f $( dirname " $0 " ) ) "
@@ -28,11 +32,11 @@ readonly SCRIPT_DIR="$(readlink -f $(dirname "$0"))"
2832# Bind the PostgreSQL server to port 5432 on the host, so that the host can connect to it.
2933# Bind the pgadmin server to port 8888 on the host, so that the host can connect to it.
3034if ! podman pod exists dataconnect_postgres ; then
31- podman pod create -p 5432:5432 -p 8888:80 dataconnect_postgres
35+ run_command podman pod create -p 5432:5432 -p 8888:80 dataconnect_postgres
3236fi
3337
3438# Start the PostgreSQL server.
35- podman \
39+ run_command podman \
3640 run \
3741 -dt \
3842 --rm \
@@ -44,7 +48,7 @@ podman \
4448# Start the pgadmin4 server.
4549readonly PGADMIN_EMAIL=
" [email protected] " 4650readonly PGADMIN_PASSWORD=" password"
47- podman \
51+ run_command podman \
4852 run \
4953 -dt \
5054 --rm \
@@ -55,13 +59,9 @@ podman \
5559 --mount " type=volume,src=dataconnect_pgadmin_data,dst=/var/lib/pgadmin" \
5660 docker.io/dpage/pgadmin4
5761
58- # Turn off verbose logging so that the epilogue below is not littered with bash statements.
59- set +xv
6062echo
6163
6264cat << EOF
63- SUCCESS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
64-
6565PostegreSQL server running on port 5432
6666The pgAdmin web UI can be viewed at http://localhost:8888
6767The pgAdmin login credentails are: username "${PGADMIN_EMAIL} " and password "${PGADMIN_PASSWORD} "
@@ -76,7 +76,6 @@ To delete the postgresql database, run
7676To delete the containers, run
7777 podman pod rm --force dataconnect_postgres
7878
79- When running the Firebase Data Connect emulator, use this postgresql connection string
80- in .firebaserc:
79+ When running the Firebase Data Connect emulator, use this postgresql connection string:
8180 postgresql://postgres:postgres@localhost:5432?sslmode=disable
8281EOF
0 commit comments