-
-
Save hassek/3118567 to your computer and use it in GitHub Desktop.
FabFile
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
#To be able to use this, please do a symbolic link into project root: | |
#cd yourproject | |
#ln -s environments/my_own_fabfile.py fabfile.py | |
from fabric.api import env, local, run, cd, sudo | |
from fabric.decorators import hosts | |
env.project_root = '~/WebSites/PROJECT' | |
#from fabric.contrib import django | |
env.user = "USER" | |
env.password = "PASSWORD" | |
web1 = "PATH" | |
#def get_messages(): | |
#with prefix('workon XXXX'): | |
##django.project('XXXX') | |
#django.settings_module('settings') | |
@hosts(web1) | |
def up_st(): | |
with cd("PATH"): | |
local("git push origin staging") | |
run("git pull origin staging") | |
sudo("/etc/init.d/apache2 restart") | |
local("git pull origin staging") | |
local("git push origin staging") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment