Created
September 3, 2012 09:48
-
-
Save kmike/3608160 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 local, settings | |
from taskset import task_method | |
from fab_deploy.utils import define_apps | |
from fab_deploy.project import WebProject | |
from fab_deploy.webserver.nginx import Nginx | |
from fab_deploy.webserver.apache import Apache | |
from fab_deploy.django import Django | |
from fab_deploy import system | |
from fab_deploy.db import postgres | |
class Project(WebProject): | |
apps = define_apps( | |
django = Django( | |
frontend = Nginx(), | |
backend = Apache(), | |
remote_config = 'my_project/config.server.py', | |
local_config = 'my_project/config.py', | |
), | |
) | |
@task_method | |
def push(self, *args, **kwargs): | |
with settings(warn_only=True): | |
local("hg push ssh://[email protected]/user/my_project --new-branch") | |
super(Project, self).push(*(args+('notest',)), **kwargs) | |
self.update_web_servers() | |
self.apps.django.manage('collectstatic --noinput') | |
project = Project() | |
project.expose_to_current_module() | |
@project.define_host('my_project@my_project.ru') | |
def testing(): | |
return dict( | |
DB_USER = 'user', | |
DB_PASSWORD = 'password', | |
DB_BACKEND = postgres.instance, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment