28 lines
640 B
Bash
Executable File
28 lines
640 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
target="$1"
|
|
|
|
function rsync_command() {
|
|
rsync -varzLP --delete "result-${target}/" "schabernack@yuzuru.sbruder.xyz:${directory}" "$@"
|
|
}
|
|
|
|
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_command --include "episodes" --include "episodes/*" --exclude "*"
|
|
rsync_command
|