You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
700 B

#!/usr/bin/env bash
set -euo pipefail
target="$1"
case "$target" in
"staging")
nix_package="schulischer-schabernack-staging"
directory="staging"
;;
"production")
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "Not on master, refusing to deploy to production."
exit 1
fi
nix_package="schulischer-schabernack"
directory="production"
;;
*)
echo "Invalid target ${SCHABERNACK_ENV}"
exit 1
;;
esac
nix build -o "result-${target}" -L ".#${nix_package}"
rsync -vacrzLP --delete --delay-updates "result-${target}/" "schabernack@yuzuru.sbruder.xyz:${directory}"