Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created November 12, 2008 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svetlyak40wt/24148 to your computer and use it in GitHub Desktop.
Save svetlyak40wt/24148 to your computer and use it in GitHub Desktop.
My script for http://aartemenko.com deployment.
def production():
config.fab_hosts = ['aartemenko.com']
config.fab_user = 'pythonist'
def testing():
config.fab_hosts = ['localhost',]
def aartemenko():
config.project = 'aartemenko'
config.packages = [
'Django-with-blackjack',
'django-dzenlog[tagging]',
'dzenlog-text',
'django-markdown2',
'django-openid',
'django-faces',
'django-extensions>=0.4-pre',
'threadedcomments>=0.4.1',
'mysql-python',
'pygments',
]
def update():
require('fab_hosts', provided_by=[production, testing])
require('project', provided_by=[aartemenko,])
require('packages', provided_by=[aartemenko,])
run('mkdir -p ~/env')
run('mkdir -p ~/projects')
run('cd ~/env && test -d $(project) || virtualenv $(project)')
run('cd ~/projects && test -d $(project) || git clone /home/art/git-private/$(project).git')
run('cd ~/projects && test -d $(project) && cd $(project) && git pull origin master')
for config.package in config.packages:
run('~/env/$(project)/bin/easy_install -f http://pypi.aartemenko.com/ -U "$(package)"')
def pull():
require('fab_hosts', provided_by=[production, testing])
require('project', provided_by=[aartemenko,])
run('cd ~/projects && test -d $(project) && cd $(project) && git pull origin master')
def restart():
require('fab_hosts', provided_by=[production, testing])
require('project', provided_by=[aartemenko,])
sudo('/etc/init.d/django-fcgi restart $(project)')
def stop():
require('fab_hosts', provided_by=[production, testing])
require('project', provided_by=[aartemenko,])
sudo('/etc/init.d/django-fcgi stop $(project)')
def start():
require('fab_hosts', provided_by=[production, testing])
require('project', provided_by=[aartemenko,])
sudo('/etc/init.d/django-fcgi start $(project)')
def lighttpd_start():
require('fab_hosts', provided_by=[production, testing])
sudo('/etc/init.d/lighttpd start')
def lighttpd_stop():
require('fab_hosts', provided_by=[production, testing])
sudo('/etc/init.d/lighttpd stop')
def lighttpd_restart():
require('fab_hosts', provided_by=[production, testing])
sudo('/etc/init.d/lighttpd restart')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment