From 14f481f541335e418a7d034e9587fcf90d015acb Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 1 Feb 2019 09:44:19 -0800 Subject: Add deploy script --- README.md | 7 ++----- deploy.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100755 deploy.sh diff --git a/README.md b/README.md index 6b88493..a093a45 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,9 @@ To build the production server config locally: nix-build --attr system ./nixos.nix -To deploy manually after building: +To deploy (will ask for ssh passphrase 2x): - nix-build --attr system ./nixos.nix - nix copy --to "ssh://root@simatime.com" ./result - # manually copy the final /nix/store/... path and: - ssh root@simatime.com sudo /nix/store/.../bin/switch-to-configuration switch + ./deploy.sh When that damn bug gets fixed, we could just do: diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..232221c --- /dev/null +++ b/deploy.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +rm -f ./result +nix-build --attr system ./nixos.nix +nix copy --to "ssh://root@simatime.com" ./result + +path=$(readlink -n ./result) +ssh root@simatime.com sudo "$path/bin/switch-to-configuration" switch -- cgit v1.2.3