Created
September 19, 2014 10:57
-
-
Save pyghassen/349391c562f3274643f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os.path import dirname, abspath | |
from fabric.api import local, task, lcd | |
PROJECT_ROOT = dirname(abspath(__file__)) | |
@task | |
def update_os(): | |
"""Updates Ubuntu""" | |
local("sudo apt-get update") | |
@task | |
def upgrade_os(): | |
"""Upgrades Ubuntu""" | |
local("sudo apt-get -y upgrade") | |
@task | |
def sync(): | |
""" | |
""" | |
with lcd(PROJECT_ROOT): | |
local("git pull origin ghassen") | |
@task | |
def reinstall(): | |
""" | |
""" | |
with lcd(PROJECT_ROOT): | |
local("sudo pip install -r requirements.txt") | |
local("python setup.py build") | |
local("sudo python setup.py install") | |
@task | |
def restart_server(): | |
""" | |
""" | |
local("supervisorctl restart my_server") | |
local("supervisorctl restart celery_server") | |
@task | |
def update(): | |
""" | |
""" | |
sync() | |
reinstall() | |
restart_server() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment