-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfabfile.py
34 lines (25 loc) · 1.21 KB
/
fabfile.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
#!/usr/bin/python
from fabric.api import run, env
from fabric.operations import abort
def prod():
env.user = 'liberateca'
env.hosts = [ 'liberateca.net' ]
# define needed functions here.
def test():
result = run('cd /srv/liberweb/liberweb/ && source virtual/bin/activate && cd petateca && python manage.py test serie')
if result.failed:
abort('Fallo en el test de serie')
result = run('cd /srv/liberweb/liberweb/ && source virtual/bin/activate && cd petateca && python manage.py test api')
if result.failed:
abort('Fallo en el test de API')
def deploy():
#test()
run('cd /srv/liberweb/liberweb/ && git pull alabs master')
run('cd /srv/liberweb/liberweb/ && source virtual/bin/activate && python setup.py develop')
run('cd /srv/liberweb/liberweb/ && source virtual/bin/activate && cd petateca && python manage.py syncdb --migrate')
# update_index()
run('sudo service uwsgi restart')
def sendinvitations():
run('cd /srv/liberweb/liberweb/ && source virtual/bin/activate && cd petateca/ && python manage.py sendinvitations')
def update_index():
run('cd /srv/liberweb/liberweb/ && source virtual/bin/activate && cd petateca/ && python manage.py update_index')