aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comments/comments.service12
-rwxr-xr-xrefresh.sh10
2 files changed, 22 insertions, 0 deletions
diff --git a/comments/comments.service b/comments/comments.service
new file mode 100644
index 0000000..b511915
--- /dev/null
+++ b/comments/comments.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Comments service
+After=postgres.service
+
+[Service]
+User=comments
+ExecStart=/usr/local/bin/comments
+Restart=on-failure
+Environment="DATABASE_URL=postgres:///comments"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/refresh.sh b/refresh.sh
index 60eeac8..9c753a0 100755
--- a/refresh.sh
+++ b/refresh.sh
@@ -3,5 +3,15 @@
set -e
git pull
+
+# Copy static site
hugo
cp -r public/* /var/www/mfashby.net/
+
+# build & install comments app
+pushd comments
+cargo build --release
+install -m755 target/release/comments /usr/local/bin/comments
+install -m755 comments.service /etc/systemd/system/comments.service
+popd
+systemctl restart comments