Move all meta scripts to central directory

This commit is contained in:
Joscha 2025-03-01 02:27:08 +01:00
parent 84d631a9c3
commit 5d1b740c20
8 changed files with 70 additions and 47 deletions

22
meta/build-typst-plugin Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env fish
set_color --bold yellow
echo "#############"
echo "## Prepare ##"
echo "#############"
set_color
rustup target add wasm32-unknown-unknown
pushd showbits-typst-plugin
echo
set_color --bold yellow
echo "###########"
echo "## Build ##"
echo "###########"
set_color
cargo build --release --target wasm32-unknown-unknown
or return 1

5
meta/clean Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env fish
cargo clean
pushd showbits-typst-plugin
cargo clean

43
meta/spinch/deploy Executable file
View file

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

View file

@ -0,0 +1,19 @@
[Unit]
Description=Showbits Thermal Printer Tunnel
# https://wiki.archlinux.org/title/Systemd#Running_services_after_the_network_is_up
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=ssh plugh@plugh.de -NR 8005:localhost:8001 -o ExitOnForwardFailure=yes
Restart=on-failure
RestartSec=1min
User=bondrucker
Group=bondrucker
WorkingDirectory=~
[Install]
WantedBy=multi-user.target

View file

@ -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