From e5dfd53b9a3fa3befc5ab57d081c210450e44ce7 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Mon, 17 Jan 2022 13:53:43 -0800 Subject: [PATCH] examples: poetry-driven git scripts & aurweb service This introduces examples of a gunicorn systemd service in addition to git script wrappers that can be used for poetry virtualenv-driven installations. Signed-off-by: Kevin Morris --- examples/aurweb-git-auth.sh | 6 ++++++ examples/aurweb-git-serve.sh | 6 ++++++ examples/aurweb-git-update.sh | 6 ++++++ examples/aurweb.service | 16 ++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 examples/aurweb-git-auth.sh create mode 100644 examples/aurweb-git-serve.sh create mode 100644 examples/aurweb-git-update.sh create mode 100644 examples/aurweb.service diff --git a/examples/aurweb-git-auth.sh b/examples/aurweb-git-auth.sh new file mode 100644 index 00000000..3e4defd4 --- /dev/null +++ b/examples/aurweb-git-auth.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Wrapper script used to call aurweb-git-update externally when +# utilizing an app-based virtualenv. +aurweb_dir="$HOME" +cd $aurweb_dir +exec poetry run aurweb-git-auth "$@" diff --git a/examples/aurweb-git-serve.sh b/examples/aurweb-git-serve.sh new file mode 100644 index 00000000..3a64dcbd --- /dev/null +++ b/examples/aurweb-git-serve.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Wrapper script used to call aurweb-git-update externally when +# utilizing an app-based virtualenv. +aurweb_dir="$HOME" +cd $aurweb_dir +exec poetry run aurweb-git-serve "$@" diff --git a/examples/aurweb-git-update.sh b/examples/aurweb-git-update.sh new file mode 100644 index 00000000..808dbccd --- /dev/null +++ b/examples/aurweb-git-update.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Wrapper script used to call aurweb-git-update externally when +# utilizing an app-based virtualenv. +aurweb_dir="$HOME" +cd $aurweb_dir +exec poetry run aurweb-git-update "$@" diff --git a/examples/aurweb.service b/examples/aurweb.service new file mode 100644 index 00000000..9c482030 --- /dev/null +++ b/examples/aurweb.service @@ -0,0 +1,16 @@ +[Unit] +Description=aurweb asgi server + +[Description] +User=aur +WorkingDirectory=/srv/http/aurweb +ExecStart=/usr/bin/poetry run gunicorn \ + --log-config /srv/http/aurweb/logging.conf \ + --bind '0.0.0.0:8000' \ + --forwarded-allow-ips '*' \ + --workers 4 \ + -k uvicorn.workers.UvicornWorker \ + aurweb.asgi:app + +[Install] +WantedBy=multi-user.target