Clean up install/exec
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
3bcb8db974
commit
3a4af41f38
63
.drone.yml
63
.drone.yml
|
@ -24,6 +24,35 @@ steps:
|
|||
password:
|
||||
from_secret: pypi_pwd
|
||||
|
||||
- name: push
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_host
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
source:
|
||||
- dist/morss-*.tar.gz
|
||||
- morss-helper
|
||||
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_host
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
script_stop: true
|
||||
script:
|
||||
- sudo pip install --upgrade morss-*.tar.gz[full]
|
||||
- sudo mv morss-helper /usr/bin/local/morss-helper
|
||||
- sudo rm /root/morss-*.tar.gz morss-helper
|
||||
- sudo morss-helper reload
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
|
@ -60,37 +89,3 @@ trigger:
|
|||
|
||||
depends_on:
|
||||
- test
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: ssh
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_host
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
script_stop: true
|
||||
script:
|
||||
- sudo pip install --upgrade morss[full]
|
||||
- "pid=$$(sudo pidof 'gunicorn: master [morss]')"
|
||||
- sudo kill -s USR2 $$pid
|
||||
- sudo kill -s WINCH $$pid
|
||||
- sudo kill -s TERM $$pid
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
depends_on:
|
||||
- python
|
||||
|
|
|
@ -10,5 +10,5 @@ RUN set -ex; \
|
|||
|
||||
USER 1000:1000
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "/app/docker-entry.sh"]
|
||||
ENTRYPOINT ["/bin/sh", "/app/morss-helper"]
|
||||
CMD ["run"]
|
||||
|
|
|
@ -168,7 +168,7 @@ write_files:
|
|||
permissions: 744
|
||||
content: |
|
||||
#!/bin/sh
|
||||
gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - --daemon morss
|
||||
/app/morss-helper
|
||||
|
||||
runcmd:
|
||||
- source /etc/environment
|
||||
|
|
|
@ -6,6 +6,12 @@ if [ "$1" = "sh" ] || [ "$1" = "bash" ]; then
|
|||
elif [ -z "$1" ] || [ "$@" = "run" ]; then
|
||||
gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - morss
|
||||
|
||||
elif [ "$@" = "reload" ]; then
|
||||
pid=$(sudo pidof 'gunicorn: master [morss]')
|
||||
kill -s USR2 $pid
|
||||
kill -s WINCH $pid
|
||||
kill -s TERM $pid
|
||||
|
||||
else
|
||||
morss $@
|
||||
|
Loading…
Reference in New Issue