commit c1957a6896f6eb9253e978328164d6ee01b0ca02 (tree)
parent 5e512675dc4378b18bdc42d51890d60e9b12f6a8
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date: Mon, 26 Feb 2024 00:15:15 +0200
deployerbot: remove --all-systems
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/services/deployerbot/default.nix b/modules/services/deployerbot/default.nix
@@ -73,7 +73,8 @@ in {
script = let
deployDerivationsStr = builtins.concatStringsSep " " cfg.deployDerivations;
in ''
- set -x
+ set -xeuo pipefail
+
export GIT_SSH_COMMAND="ssh -i ''${CREDENTIALS_DIRECTORY}/ssh-key"
if [[ ! -d config ]]; then
git clone ${cfg.repo} config
@@ -85,19 +86,20 @@ in {
fi
nix flake update --accept-flake-config --commit-lock-file
- nix flake check --all-systems --accept-flake-config
+ # TODO --all-systems
+ nix flake check --accept-flake-config
git push origin main
+ EXITCODE=0
${pkgs.deploy-rs.deploy-rs}/bin/deploy \
--ssh-opts="-i ''${CREDENTIALS_DIRECTORY}/ssh-key" \
--ssh-user=deployerbot-follower \
--confirm-timeout 60 \
--skip-checks \
--targets ${deployDerivationsStr} -- \
- --accept-flake-config
+ --accept-flake-config || EXITCODE=1
# Optional deployments
- EXITCODE=0
${lib.concatLines (map mkOptional cfg.deployIfPresent)}
exit $EXITCODE