diff --git a/build-and-deploy.sh b/build-and-deploy.sh new file mode 100755 index 0000000..8e2c64c --- /dev/null +++ b/build-and-deploy.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +dub clean +rm -f web-logbook +dub build --build=release +echo "Stopping web-logbook service." +ssh -f root@andrewlalis.com 'systemctl stop web-logbook' +echo "Uploading new binary." +scp web-logbook root@andrewlalis.com:/opt/web-logbook/ +echo "Starting web-logbook service." +ssh -f root@andrewlalis.com 'systemctl start web-logbook' diff --git a/source/app.d b/source/app.d index 8059366..6886497 100644 --- a/source/app.d +++ b/source/app.d @@ -19,6 +19,9 @@ void main() { if (props.has("port")) { config.port = props.get("port").to!ushort; } + if (props.has("workers")) { + config.workerPoolSize = props.get("workers").to!size_t; + } } initDb(); HttpServer server = new HttpServer((ref HttpRequestContext ctx) { diff --git a/web-logbook.service b/web-logbook.service new file mode 100644 index 0000000..96293d3 --- /dev/null +++ b/web-logbook.service @@ -0,0 +1,13 @@ +[Unit] +Description=web-logbook +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/web-logbook +ExecStart=/opt/web-logbook/web-logbook +Restart=always + +[Install] +WantedBy=multi-user.target