add admin scripts over from treehouse

would be nice to rewrite these as a standalone utility that integrates with Nix someday i guess
This commit is contained in:
りき萌 2024-08-23 22:37:49 +02:00
parent be6a47ae13
commit 384e64009e
6 changed files with 64 additions and 0 deletions

4
admin/daemon/common.bash Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
reload_fifo="/tmp/rkgk_reload.fifo"
build_log="/tmp/rkgk_build.log"

11
admin/daemon/deploy.bash Normal file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
cd ~/repo
source "${BASH_SOURCE%/*}/common.bash"
git pull
bash "${BASH_SOURCE%/*}/reload.bash"
echo "^C to exit build log ($build_log)"
tail --retry -f "$build_log"

6
admin/daemon/reload.bash Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
source "${BASH_SOURCE%/*}/common.bash"
echo "Reloading"
echo "reload" > "$reload_fifo"