Skip to content

Commit

Permalink
devops: Work without local psql
Browse files Browse the repository at this point in the history
  • Loading branch information
jhf committed Nov 29, 2024
1 parent a44fa0c commit 0c90264
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devops/manage-statbus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ case "$action" in
done
;;
'activate_sql_saga' )
eval $(./devops/manage-statbus.sh postgres-variables)
PGUSER=supabase_admin psql -c 'create extension sql_saga cascade;'
PGUSER=supabase_admin ./devops/manage-statbus.sh psql -c 'create extension sql_saga cascade;'
;;
'create-db-structure' )
pushd cli
Expand Down Expand Up @@ -570,7 +569,10 @@ EOS
echo 'select statistical_unit_refresh_now();' | ./devops/manage-statbus.sh psql
;;
'psql' )
eval $(./devops/manage-statbus.sh postgres-variables)
# Only set postgres variables if they're not already set
if [ -z "${PGHOST:-}" ] || [ -z "${PGPORT:-}" ] || [ -z "${PGDATABASE:-}" ] || [ -z "${PGUSER:-}" ] || [ -z "${PGPASSWORD:-}" ]; then
eval $(./devops/manage-statbus.sh postgres-variables)
fi
# The local psql is always tried first, as it has access to files
# used for copying in data.
if $(which psql > /dev/null); then
Expand Down

0 comments on commit 0c90264

Please sign in to comment.