File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
ansible/files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -277,16 +277,23 @@ function initiate_upgrade {
277
277
NIX_FLAKE_VERSION=$( cat " $PG_UPGRADE_BIN_DIR /nix_flake_version" )
278
278
279
279
if [ " $IS_NIX_BASED_SYSTEM " = " false" ]; then
280
- echo " 1.1. Nix is not installed; installing."
281
-
282
- curl --proto ' =https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
283
- --extra-conf " substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
284
- --extra-conf " trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
280
+ if [ ! -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then
281
+ if ! command -v nix > /dev/null; then
282
+ echo " 1.1. Nix is not installed; installing."
283
+
284
+ curl --proto ' =https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
285
+ --extra-conf " substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
286
+ --extra-conf " trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
287
+ else
288
+ echo " 1.1. Nix is installed; moving on."
289
+ fi
290
+ fi
285
291
fi
286
292
287
293
echo " 1.2. Installing flake revision: $NIX_FLAKE_VERSION "
288
294
# shellcheck disable=SC1091
289
295
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
296
+ nix-collect-garbage -d > /tmp/pg_upgrade-nix-gc.log 2>&1 || true
290
297
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)
291
298
PGSHARENEW=" $PG_UPGRADE_BIN_DIR /share/postgresql"
292
299
fi
You can’t perform that action at this time.
0 commit comments