Skip to content

Instantly share code, notes, and snippets.

@kmike
Created September 3, 2012 09:38
Show Gist options
  • Save kmike/3608137 to your computer and use it in GitHub Desktop.
Save kmike/3608137 to your computer and use it in GitHub Desktop.
from fabric.api import local, settings
from taskset import task_method
from fab_deploy.utils import define_host, 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):
@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()
apps.django.manage('collectstatic --noinput')
apps = define_apps(
django = Django(
frontend = Nginx(),
backend = Apache(),
remote_config = 'my_project/config.server.py',
local_config = 'my_project/config.py',
),
)
Project().expose_to_current_module()
@define_host('my_project@my_project.ru', host_apps=apps)
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