Created
August 21, 2011 20:11
-
-
Save acslater00/1161090 to your computer and use it in GitHub Desktop.
Fabric
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.hosts = ['[email protected]] | |
def deploy(staging="/home/acslater/staging/iris", target="/home/acslater/irisforwestchester.com/"): | |
# pull latest code | |
with cd(staging): | |
run("git pull origin master") | |
# create directories if don't exist | |
with cd(target): | |
run("mkdir -p iris") | |
run("mkdir -p public") | |
# copy things | |
with cd(staging): | |
# passenger file into home directory | |
run("cp passenger_wsgi.py {0}".format(target)) | |
# to move into "public directory" | |
tomove_public = ( | |
"media", # media directory, complete | |
"templates" # templates directory, complete | |
) | |
for elem in tomove_public: | |
run("cp -r {0} {1}/public".format(elem, target)) | |
# to move into "iris" directory | |
tomove_iris = ( | |
"*.py", | |
"python/iris/*.py" | |
) | |
for elem in tomove_iris: | |
run("cp -r {0} {1}/iris".format(elem, target)) | |
# restart python remotely... | |
run("pkill python") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment