aboutsummaryrefslogtreecommitdiff
path: root/create-deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'create-deploy.sh')
-rwxr-xr-xcreate-deploy.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/create-deploy.sh b/create-deploy.sh
new file mode 100755
index 0000000..5c5057e
--- /dev/null
+++ b/create-deploy.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+rm -fr dist
+dub build -b release
+install -Dm755 boobbot -t dist/bin
+mkdir -p dist/rt
+cp -r systemd dist/
+
+cat >dist/install.sh <<"EOF"
+#!/usr/bin/env bash
+(
+cd "$(dirname -- "$0")"
+root="$PWD"
+echo "Switched to $root"
+(
+ cd systemd
+ for f in *; do
+ sed -e "s|SOURCE|$root|g" < "$f" > "/etc/systemd/system/$f"
+ done
+)
+)
+
+EOF
+chmod +x dist/install.sh