forked from alphagov/fabric-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
41 lines (27 loc) · 753 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from fabric.api import *
@task
def restart(app):
"""Restart a particular app"""
_service(app, 'restart')
@task
def reload(app):
"""Reload a particular app.
Unlike `restart`, this will tell the app to reload itself gracefully; for
apps running under unicornherder, this will spin up a new process, then
stop the old one after a short overlap period.
"""
_service(app, 'reload')
@task
def stop(app):
"""Stop a particular app"""
_service(app, 'stop')
@task
def start(app):
"""Start a particular app"""
_service(app, 'start')
@task
def status(app):
"""Check status of a particular app"""
_service(app, 'status')
def _service(app, command):
sudo('service {} {}'.format(app, command))