forked from magul/wysadzulice.pl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
36 lines (28 loc) · 847 Bytes
/
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
# -*- coding: utf-8 -*-
u"""
.. module:: fabfile
Be aware, that becaus fabric doesn't support py3k You need to execute this
particular script using Python 2.
"""
import contextlib
from fabric.api import cd
from fabric.api import env
from fabric.api import prefix
from fabric.api import run
env.user = 'root'
env.hosts = ['wysadzulice.pl']
env.forward_agent = True
def update():
u"""Function defining all steps required to properly update application."""
with contextlib.nested(
cd('/var/www/wysadzulice_pl'),
prefix('workon wysadzulice_pl')
):
run('git pull')
run('git checkout master')
run('python manage.py migrate --traceback')
run('npm cache clear')
run('rm -rf ./node_modules')
run('npm install')
run('gulp build')
run('service apache2 restart')