Skip to content

Commit 5761fd0

Browse files
Fix CI
1 parent fbb933e commit 5761fd0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[env]
22

33
# Scope down tracing, to filter out external lib tracing.
4-
RUST_LOG="web_server=debug,lib_web=debug"
4+
RUST_LOG="web_server=debug,lib_web=debug,services=debug"
55

66
# This will be relative to Cargo.toml
77
# In deployed images, probably use absolute path.

scripts/init_db.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,16 @@ then
5656
>&2 echo "Postgres is still unavailable - sleeping"
5757
sleep 1
5858
done
59+
# Create the application user
60+
CREATE_QUERY="CREATE USER ${APP_USER} WITH PASSWORD '${APP_USER_PWD}';"
61+
docker exec -it "${CONTAINER_NAME}" psql -U "${SUPERUSER}" -c "${CREATE_QUERY}"
5962

63+
# Grant create db privileges to the app user
64+
GRANT_QUERY="ALTER USER ${APP_USER} CREATEDB;"
65+
docker exec -it "${CONTAINER_NAME}" psql -U "${SUPERUSER}" -c "${GRANT_QUERY}"
66+
fi
67+
68+
>&2 echo "Postgres is up and running on port ${DB_PORT} - running migrations now!"
6069
# Keep pinging Postgres until it's ready to accept commands
6170
export PGPASSWORD="${DB_PASSWORD}"
6271
until psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q'; do

0 commit comments

Comments
 (0)