Add deploy script

This commit is contained in:
Simon Bruder 2021-12-11 19:33:14 +01:00
parent 564a4f3366
commit 0dfd8746d3
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

22
deploy.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
target="$1"
case "$target" in
"staging")
nix_package="schulischer-schabernack-staging"
directory="staging"
;;
"production")
nix_package="schulischer-schabernack"
directory="production"
;;
*)
echo "Invalid target ${SCHABERNACK_ENV}"
exit 1
;;
esac
nix build -o "result-${target}" -L ".#${nix_package}"
rsync -varzLP --delete "result-${target}/" "schabernack@yuzuru.sbruder.xyz:${directory}"