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
RevLine 
[9666]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
[9780]12env.hosts = ['sunfire.wirelessleiden.nl']
13
[9666]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")
[9749]22 local("./manage.py syncdb")
[9666]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 -")
[9780]28
29def refresh():
30 code_dir = '/usr/local/django_gheat'
31 with cd(code_dir):
[9817]32 sudo("svn up", user='wlrobot')
33 sudo("./manage.py collectstatic --noinput", user='wlrobot')
[9780]34 sudo("apachectl -k graceful")
[9666]35
36def deploy():
37 code_dir = '/usr/local/django_gheat'
38 with cd(code_dir):
[9817]39 sudo("svn up", user='wlrobot')
[9666]40 sudo("apachectl -k graceful")
41 run("./manage.py sqlreset gheat | ./manage.py dbshell")
[9817]42 sudo("./import_scan_data.sh", user='wlrobot')
[9823]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')
[9666]46 run("../genesis/tools/gformat.py full-export | ./manage.py import_nodes -")
Note: See TracBrowser for help on using the repository browser.