From 25e1679701f950d97aaa7b1b6f3d92d13456f26d Mon Sep 17 00:00:00 2001 From: Joscha Date: Thu, 27 Feb 2025 14:51:34 +0100 Subject: [PATCH] Deploy thermal printer to spinch --- .../meta/deploy-to-spinch | 22 +++++++++++++++++++ showbits-thermal-printer/meta/spinch.service | 14 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 showbits-thermal-printer/meta/deploy-to-spinch create mode 100644 showbits-thermal-printer/meta/spinch.service diff --git a/showbits-thermal-printer/meta/deploy-to-spinch b/showbits-thermal-printer/meta/deploy-to-spinch new file mode 100755 index 0000000..82974b9 --- /dev/null +++ b/showbits-thermal-printer/meta/deploy-to-spinch @@ -0,0 +1,22 @@ +#!/usr/bin/env fish + +# This script is meant to be executed inside the repo root. + +cross build --release \ + --package showbits-thermal-printer \ + --target aarch64-unknown-linux-gnu +or return 1 + +rsync -vP \ + showbits-thermal-printer/meta/spinch.service \ + bondrucker@spinch:showbits-thermal-printer.service +or return 1 + +rsync -vP \ + target/aarch64-unknown-linux-gnu/release/showbits-thermal-printer \ + bondrucker@spinch:showbits-thermal-printer +or return 1 + +ssh root@spinch "\ +systemctl daemon-reload && \ +systemctl restart showbits-thermal-printer.service" diff --git a/showbits-thermal-printer/meta/spinch.service b/showbits-thermal-printer/meta/spinch.service new file mode 100644 index 0000000..944e67e --- /dev/null +++ b/showbits-thermal-printer/meta/spinch.service @@ -0,0 +1,14 @@ +[Unit] +Description=Showbits Thermal Printer + +[Service] +Type=simple +ExecStart=/home/bondrucker/showbits-thermal-printer 0.0.0.0:8001 queue -p /dev/usb/lp0 +Restart=on-failure + +User=bondrucker +Group=bondrucker +WorkingDirectory=~ + +[Install] +WantedBy=multi-user.target