Skip to content

Commit 04c46ee

Browse files
authored
ci: set search_path during sandbox init if PGHOST is defined
1 parent f048236 commit 04c46ee

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

dev/deploy-to-container/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ async function main () {
247247
Env: [
248248
`LETSENCRYPT_HOST=${hostname}`,
249249
`VIRTUAL_HOST=${hostname}`,
250-
`VIRTUAL_PORT=8000`
250+
`VIRTUAL_PORT=8000`,
251+
`PGHOST=dt-db-${branch}`
251252
],
252253
Labels: {
253254
appversion: `${argv.appversion}` ?? '0.0.0',

dev/deploy-to-container/start.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ echo "Creating data directories..."
2222
chmod +x ./app-create-dirs.sh
2323
./app-create-dirs.sh
2424

25-
echo "Altering PG search path..."
26-
psql -U django -h db -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
25+
if [ -n "$PGHOST" ]; then
26+
echo "Altering PG search path..."
27+
psql -U django -h $PGHOST -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
28+
fi
2729

2830
echo "Running Datatracker checks..."
2931
./ietf/manage.py check

0 commit comments

Comments
 (0)