Skip to content

Commit 5d9ddf9

Browse files
committed
chore: additional pgroonga testing
1 parent a967eb1 commit 5d9ddf9

File tree

1 file changed

+7
-0
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+7
-0
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ function initiate_upgrade {
289289
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
290290
PG_UPGRADE_BIN_DIR=$(nix build "github:supabase/postgres/${NIX_FLAKE_VERSION}#psql_15/bin" --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes)
291291
PGSHARENEW="$PG_UPGRADE_BIN_DIR/share/postgresql"
292+
293+
# Determine if pgroonga is enabled
294+
PGROONGA_ENABLED=$(run_sql -A -t -c "SELECT EXISTS(SELECT 1 FROM pg_extension WHERE extname = 'pgroonga');")
295+
if [ "$PGROONGA_ENABLED" = "t" ]; then
296+
sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/#{$NIX_FLAKE_VERSION}#supabase-groonga"
297+
fi
292298
fi
293299

294300
PGBINNEW="$PG_UPGRADE_BIN_DIR/bin"
@@ -403,6 +409,7 @@ EOF
403409
)
404410

405411
if [ "$IS_NIX_BASED_SYSTEM" = "true" ]; then
412+
export GRN_PLUGINS_DIR="/var/lib/postgresql/.nix-profile/lib/groonga/plugins"
406413
UPGRADE_COMMAND=". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $UPGRADE_COMMAND"
407414
fi
408415
LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres

0 commit comments

Comments
 (0)