Created
November 12, 2008 12:59
-
-
Save svetlyak40wt/24148 to your computer and use it in GitHub Desktop.
My script for http://aartemenko.com deployment.
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
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