-
Notifications
You must be signed in to change notification settings - Fork 6
/
fabfile.py
61 lines (49 loc) · 1.5 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
#
# this file describes the various tasks necessary to manage and build homepage
# author: alec aivazis
from fabric.api import *
# the server hosting the project
env.hosts = ['104.236.200.165']
# the user to connect to the server as
env.user = "feynman"
@task
def server():
""" run the local server """
local('./manage.py runserver')
@task
def update_dependencies():
""" update the project dependencies """
# go into the folder with the dependency files
with lcd('docs'):
# install python dependencies
local('pip install -r pip.txt')
# install bower dependencies
local('bower install')
# install node dependecies
local('npm install -g')
@task
def init():
""" perform the necessary tasks to initialize the project locally """
# update the local dependencies
update_dependencies()
# create the local database
local('./manage.py syncdb')
@task
def deploy():
""" deploy the application """
# push any changes to the local repository
local('git push')
# inside of the remote repository directory
with cd('repository'):
# update the repository
run('git pull origin master')
# update the local dependencies
# run('fab update_dependencies')
# update the database
# run('./manage.py migrate')
# update the static files
run('./manage.py collectstatic')
# restart the application server
run('sudo service gunicorn restart')
# end of file