ci: set search_path during sandbox init if PGHOST is defined

This commit is contained in:
Nicolas Giard 2023-02-13 22:19:24 -05:00 committed by GitHub
parent f0482363ad
commit 04c46ee201
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -247,7 +247,8 @@ async function main () {
Env: [
`LETSENCRYPT_HOST=${hostname}`,
`VIRTUAL_HOST=${hostname}`,
`VIRTUAL_PORT=8000`
`VIRTUAL_PORT=8000`,
`PGHOST=dt-db-${branch}`
],
Labels: {
appversion: `${argv.appversion}` ?? '0.0.0',

View file

@ -22,8 +22,10 @@ echo "Creating data directories..."
chmod +x ./app-create-dirs.sh
./app-create-dirs.sh
echo "Altering PG search path..."
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;'
if [ -n "$PGHOST" ]; then
echo "Altering PG search path..."
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;'
fi
echo "Running Datatracker checks..."
./ietf/manage.py check