41 lines
886 B
Bash
41 lines
886 B
Bash
|
#!/bin/sh
|
||
|
set -e
|
||
|
|
||
|
case $1 in
|
||
|
start)
|
||
|
su app -c "cd /srv && foreman run -f /etc/Procfile install"
|
||
|
su app -c "cd /srv && foreman run -f /etc/Procfile migrate"
|
||
|
daemonize -c /srv -u app /usr/bin/foreman start -f /etc/Procfile rails
|
||
|
|
||
|
;;
|
||
|
stop)
|
||
|
cat /srv/tmp/puma.pid | xargs -r kill
|
||
|
|
||
|
;;
|
||
|
reload)
|
||
|
su app -c "cd /srv && foreman run -f /etc/Procfile install"
|
||
|
cat /srv/tmp/puma.pid | xargs -r kill -USR2
|
||
|
|
||
|
;;
|
||
|
prometheus)
|
||
|
rm -f /tmp/prometheus.pid
|
||
|
|
||
|
daemonize -c /srv \
|
||
|
-p /tmp/prometheus.pid \
|
||
|
-l /tmp/prometheus.pid \
|
||
|
-u app \
|
||
|
/usr/bin/foreman start -f /etc/Procfile prometheus
|
||
|
;;
|
||
|
|
||
|
prometheus-stop)
|
||
|
cat /tmp/prometheus.pid | xargs -r kill
|
||
|
|
||
|
;;
|
||
|
|
||
|
blazer)
|
||
|
test -z "$2" || schedule="_${2}"
|
||
|
su app -c "cd /srv && foreman run -f /etc/Procfile blazer${schedule}"
|
||
|
|
||
|
;;
|
||
|
esac
|