Compare commits

..

4 Commits

Author SHA1 Message Date
pictuga 2c7844942c drone: re order deploy commands
continuous-integration/drone/push Build was killed Details
2021-12-29 15:41:29 +01:00
pictuga e12cb4567a helper: more debug options 2021-12-29 15:41:03 +01:00
pictuga b74365b121 Make helper more posix compliant 2021-12-29 15:40:43 +01:00
pictuga 2020543469 Make morss-helper executable 2021-12-29 15:37:12 +01:00
2 changed files with 7 additions and 6 deletions

View File

@ -55,7 +55,6 @@ steps:
- sudo pip install --upgrade dist/morss.tar.gz[full]
- sudo rm -r dist
- sudo mv morss-helper /usr/local/bin/morss-helper
- sudo chmod +x /usr/local/bin/morss-helper
- sudo morss-helper reload
trigger:

View File

@ -1,17 +1,19 @@
#! /bin/sh
set -ex
if ! command -v python && command -v python3 ; then
alias python='python3'
fi
function run {
run() {
gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - morss
}
function daemon {
daemon() {
gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - --daemon morss
}
function reload {
reload() {
pid=$(pidof 'gunicorn: master [morss]') # NB. requires python-setproctitle
if [ -z "$pid" ]; then
@ -27,11 +29,11 @@ function reload {
fi
}
function check {
check() {
python -m morss.crawler http://localhost:${PORT:-8000}/ > /dev/null 2>&1
}
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$(type -t "$1")" = "function" ]; then
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || command -v "$1" ; then
$@
else