source: src/django_gheat/fabfile.py@ 11407

Last change on this file since 11407 was 9823, checked in by rick, 13 years ago

Importer fails if one file files, this makes it more reliable...

File size: 1.4 KB
Line 
1#
2# Fabric files for deployment and management of django_gheat application
3#
4# Rick van der Zwet - <info@rickvanderzwet.nl>
5#
6from __future__ import with_statement
7from fabric.api import local, settings, abort, run, cd, env, sudo
8from fabric.contrib.console import confirm
9
10env.shell = "/bin/sh -c"
11
12env.hosts = ['sunfire.wirelessleiden.nl']
13
14def hello():
15 print("Hello World!")
16
17def test():
18 local("./manage.py runserver 0.0.0.0:8000")
19
20def reset():
21 local("./manage.py sqlreset gheat | ./manage.py dbshell")
22 local("./manage.py syncdb")
23
24def import_nodes():
25 local("../genesis/tools/genesis-to-yaml.pl")
26 local("../genesis/tools/gformat.py cleanup")
27 local("../genesis/tools/gformat.py full-export | ./manage.py import_nodes -")
28
29def refresh():
30 code_dir = '/usr/local/django_gheat'
31 with cd(code_dir):
32 sudo("svn up", user='wlrobot')
33 sudo("./manage.py collectstatic --noinput", user='wlrobot')
34 sudo("apachectl -k graceful")
35
36def deploy():
37 code_dir = '/usr/local/django_gheat'
38 with cd(code_dir):
39 sudo("svn up", user='wlrobot')
40 sudo("apachectl -k graceful")
41 run("./manage.py sqlreset gheat | ./manage.py dbshell")
42 sudo("./import_scan_data.sh", user='wlrobot')
43 sudo("svn up ../genesis", user='www')
44 sudo("../genesis/tools/genesis-to-yaml.pl", user='www')
45 sudo("../genesis/tools/gformat.py cleanup", user='www')
46 run("../genesis/tools/gformat.py full-export | ./manage.py import_nodes -")
Note: See TracBrowser for help on using the repository browser.