From 5d1b740c20fc39fc7dbdceb4e41d407638a68116 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 1 Mar 2025 02:27:08 +0100 Subject: [PATCH] Move all meta scripts to central directory --- meta/build-typst-plugin | 22 ++++++++++ meta/clean | 5 +++ meta/spinch/deploy | 43 +++++++++++++++++++ .../showbits-thermal-printer-tunnel.service | 0 .../spinch/showbits-thermal-printer.service | 0 .../meta/deploy-to-spinch | 40 ----------------- showbits-typst-plugin/meta/build | 4 -- showbits-typst-plugin/meta/setup | 3 -- 8 files changed, 70 insertions(+), 47 deletions(-) create mode 100755 meta/build-typst-plugin create mode 100755 meta/clean create mode 100755 meta/spinch/deploy rename showbits-thermal-printer/meta/spinch-tunnel.service => meta/spinch/showbits-thermal-printer-tunnel.service (100%) rename showbits-thermal-printer/meta/spinch.service => meta/spinch/showbits-thermal-printer.service (100%) delete mode 100755 showbits-thermal-printer/meta/deploy-to-spinch delete mode 100755 showbits-typst-plugin/meta/build delete mode 100755 showbits-typst-plugin/meta/setup diff --git a/meta/build-typst-plugin b/meta/build-typst-plugin new file mode 100755 index 0000000..a0aa3be --- /dev/null +++ b/meta/build-typst-plugin @@ -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 diff --git a/meta/clean b/meta/clean new file mode 100755 index 0000000..6ec49a6 --- /dev/null +++ b/meta/clean @@ -0,0 +1,5 @@ +#!/usr/bin/env fish + +cargo clean +pushd showbits-typst-plugin +cargo clean diff --git a/meta/spinch/deploy b/meta/spinch/deploy new file mode 100755 index 0000000..7807f31 --- /dev/null +++ b/meta/spinch/deploy @@ -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 \ +" diff --git a/showbits-thermal-printer/meta/spinch-tunnel.service b/meta/spinch/showbits-thermal-printer-tunnel.service similarity index 100% rename from showbits-thermal-printer/meta/spinch-tunnel.service rename to meta/spinch/showbits-thermal-printer-tunnel.service diff --git a/showbits-thermal-printer/meta/spinch.service b/meta/spinch/showbits-thermal-printer.service similarity index 100% rename from showbits-thermal-printer/meta/spinch.service rename to meta/spinch/showbits-thermal-printer.service diff --git a/showbits-thermal-printer/meta/deploy-to-spinch b/showbits-thermal-printer/meta/deploy-to-spinch deleted file mode 100755 index 8a6ffb7..0000000 --- a/showbits-thermal-printer/meta/deploy-to-spinch +++ /dev/null @@ -1,40 +0,0 @@ -#!/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 \ -" diff --git a/showbits-typst-plugin/meta/build b/showbits-typst-plugin/meta/build deleted file mode 100755 index ce10625..0000000 --- a/showbits-typst-plugin/meta/build +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env fish - -pushd showbits-typst-plugin -cargo build --release --target wasm32-unknown-unknown diff --git a/showbits-typst-plugin/meta/setup b/showbits-typst-plugin/meta/setup deleted file mode 100755 index 6df30e8..0000000 --- a/showbits-typst-plugin/meta/setup +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env fish - -rustup target add wasm32-unknown-unknown