showbits/showbits-thermal-printer/meta/deploy-to-spinch
2025-02-27 20:29:46 +01:00

40 lines
1,005 B
Fish
Executable file

#!/usr/bin/env fish
# This script is meant to be executed inside the repo root.
echo "###############"
echo "## Compiling ##"
echo "###############"
cross build --release \
--package showbits-thermal-printer \
--target aarch64-unknown-linux-gnu
or return 1
echo
echo "###############"
echo "## Uploading ##"
echo "###############"
rsync -vP \
showbits-thermal-printer/meta/spinch.service \
bondrucker@spinch:showbits-thermal-printer.service
or return 1
rsync -vP \
showbits-thermal-printer/meta/spinch-tunnel.service \
bondrucker@spinch:showbits-thermal-printer-tunnel.service
or return 1
rsync -vP \
target/aarch64-unknown-linux-gnu/release/showbits-thermal-printer \
bondrucker@spinch:showbits-thermal-printer
or return 1
echo
echo "################"
echo "## Restarting ##"
echo "################"
ssh root@spinch "\
systemctl daemon-reload \
&& systemctl restart showbits-thermal-printer.service \
&& systemctl restart showbits-thermal-printer-tunnel.service \
"