Compare commits
4 Commits
6c7c0f22fd
...
2c7844942c
Author | SHA1 | Date |
---|---|---|
pictuga | 2c7844942c | |
pictuga | e12cb4567a | |
pictuga | b74365b121 | |
pictuga | 2020543469 |
|
@ -55,7 +55,6 @@ 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:
|
||||||
|
|
12
morss-helper
12
morss-helper
|
@ -1,17 +1,19 @@
|
||||||
#! /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
|
||||||
|
|
||||||
function run {
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
function daemon {
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload {
|
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
|
||||||
|
@ -27,11 +29,11 @@ function reload {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check {
|
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" ] || [ "$(type -t "$1")" = "function" ]; then
|
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || command -v "$1" ; then
|
||||||
$@
|
$@
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue