Compare commits

..

1 Commits

Author SHA1 Message Date
pictuga 6c7c0f22fd drone: make morss-helper executable for deploy
continuous-integration/drone/push Build is failing Details
2021-12-29 14:20:18 +01:00
2 changed files with 6 additions and 7 deletions

View File

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

View File

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