19
19
# server is already running (it will just be a no-op).
20
20
21
21
set -euo pipefail
22
- set -xv
22
+
23
+ function run_command {
24
+ echo " $* "
25
+ " $@ "
26
+ }
23
27
24
28
# Determine the absolute path of the directory containing this file.
25
29
readonly SCRIPT_DIR=" $( readlink -f $( dirname " $0 " ) ) "
@@ -28,11 +32,11 @@ readonly SCRIPT_DIR="$(readlink -f $(dirname "$0"))"
28
32
# Bind the PostgreSQL server to port 5432 on the host, so that the host can connect to it.
29
33
# Bind the pgadmin server to port 8888 on the host, so that the host can connect to it.
30
34
if ! 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
32
36
fi
33
37
34
38
# Start the PostgreSQL server.
35
- podman \
39
+ run_command podman \
36
40
run \
37
41
-dt \
38
42
--rm \
@@ -44,7 +48,7 @@ podman \
44
48
# Start the pgadmin4 server.
45
49
readonly PGADMIN_EMAIL=
" [email protected] "
46
50
readonly PGADMIN_PASSWORD=" password"
47
- podman \
51
+ run_command podman \
48
52
run \
49
53
-dt \
50
54
--rm \
@@ -55,13 +59,9 @@ podman \
55
59
--mount " type=volume,src=dataconnect_pgadmin_data,dst=/var/lib/pgadmin" \
56
60
docker.io/dpage/pgadmin4
57
61
58
- # Turn off verbose logging so that the epilogue below is not littered with bash statements.
59
- set +xv
60
62
echo
61
63
62
64
cat << EOF
63
- SUCCESS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
64
-
65
65
PostegreSQL server running on port 5432
66
66
The pgAdmin web UI can be viewed at http://localhost:8888
67
67
The pgAdmin login credentails are: username "${PGADMIN_EMAIL} " and password "${PGADMIN_PASSWORD} "
@@ -76,7 +76,6 @@ To delete the postgresql database, run
76
76
To delete the containers, run
77
77
podman pod rm --force dataconnect_postgres
78
78
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:
81
80
postgresql://postgres:postgres@localhost:5432?sslmode=disable
82
81
EOF
0 commit comments