Created
July 18, 2014 13:44
-
-
Save brylor/7297c95d552683994517 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
import time | |
from fabric.api import * | |
#env.hosts = ['ubuntu@chef-server-01:22'] | |
env.roledefs = {"test":["chef-client-01"], | |
"production":["production-server"]} | |
@roles("test") | |
def test(): | |
env.user="ubuntu" | |
run("uname -a") | |
deploy() | |
@roles("production") | |
def production(): | |
env.user="deploy" | |
run("uname -a") | |
deploy() | |
def webserver(): | |
"Use the actual webserver" | |
env.hosts = ['Some VARIABLE HERE '] # Change to your server name! | |
env.requirements = 'webserver' | |
# env.user = env.prj_name | |
# env.paith = '/var/www/%(prj_name)s' % env | |
# env.virtualhost_path = env.path | |
env.path = '/var/www/html' | |
env.pysp = '%(virtualhost_path)s/lib/python2.7/site-packages' % env | |
env.tmppath = '/var/tmp/django_cache/%(prj_name)s' % env | |
def deploy(): | |
code_dir = '~/RTV/' | |
with settings(warn_only=True): | |
if run("test -d %s" % code_dir).failed: | |
run("git clone user@{some variable here fooo ddfdfd}:/var/www/html/ %s" % code_dir) | |
with cd(code_dir): | |
run("git pull") | |
run("touch app.wsgi") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment