Last active
August 29, 2015 14:12
-
-
Save andriisoldatenko/703627dabba135197d9d to your computer and use it in GitHub Desktop.
Fabric example for deplot Django
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 fabric.api import env, run, local, task | |
from fabric.colors import green | |
env.hosts = ['1.1.1.1'] | |
env.port = '8888' | |
env.user = 'root' | |
env.key_filename = '~/.ssh/id_rsa' | |
@task | |
def local_uname(): | |
local('uname -a') | |
@task | |
def remote_uname(): | |
run('uname -a') | |
print green("Start deploying...!") | |
@task | |
def pull(): | |
run('git pull origin master') | |
@task | |
def migrate(): | |
run('./manage.py migrate --all') | |
run('./manage.py migrate --list') | |
@task | |
def test(): | |
local('./manage.py test') | |
@task | |
def build_static(): | |
pass | |
@task | |
def restart_nginx(): | |
run('service nginx restart') | |
@task | |
def deploy(): | |
test() | |
remote_uname() | |
pull() | |
migrate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment