set OLD_PATH once

This commit is contained in:
Motiejus Jakštys 2023-07-30 08:56:38 +03:00
parent afd7743f37
commit d536eb5656

View File

@ -45,6 +45,7 @@
deployDerivationsStr = builtins.concatStringsSep " " deployDerivations; deployDerivationsStr = builtins.concatStringsSep " " deployDerivations;
in '' in ''
set -x set -x
OLD_PATH=$PATH
export GIT_SSH_COMMAND="${pkgs.openssh}/bin/ssh -i ''${CREDENTIALS_DIRECTORY}/ssh-key" export GIT_SSH_COMMAND="${pkgs.openssh}/bin/ssh -i ''${CREDENTIALS_DIRECTORY}/ssh-key"
if [[ ! -d config ]]; then if [[ ! -d config ]]; then
${pkgs.git}/bin/git clone ${repo} config ${pkgs.git}/bin/git clone ${repo} config
@ -55,12 +56,10 @@
${pkgs.git}/bin/git reset --hard origin/main ${pkgs.git}/bin/git reset --hard origin/main
fi fi
OLD_PATH=$PATH
export PATH=$PATH:${pkgs.git}/bin export PATH=$PATH:${pkgs.git}/bin
${pkgs.nix}/bin/nix flake update --accept-flake-config --commit-lock-file ${pkgs.nix}/bin/nix flake update --accept-flake-config --commit-lock-file
export PATH=$OLD_PATH export PATH=$OLD_PATH
OLD_PATH=$PATH
export PATH=$PATH:${pkgs.git}/bin:${pkgs.openssh}/bin:${pkgs.nix}/bin export PATH=$PATH:${pkgs.git}/bin:${pkgs.openssh}/bin:${pkgs.nix}/bin
exec ${pkgs.nix}/bin/nix run .#deploy-rs -- \ exec ${pkgs.nix}/bin/nix run .#deploy-rs -- \
--ssh-opts="-i ''${CREDENTIALS_DIRECTORY}/ssh-key" \ --ssh-opts="-i ''${CREDENTIALS_DIRECTORY}/ssh-key" \