The pain of Capistrano
Capistrano is a tool used to manage server deployments. It promises to be "Simple.", but from my experience it's far from simple! The logo should probably look like this (a tropical storm):
On Plurk we used Capistrano and today we have finally moved away for Fabric. The move is because of Capistrano's complexity and because the lead dev has left the project. First of all, Fabric is far from perfect, but it's much more simple than Capistrano and it does not offer a "domain specific language" for managing deployments. And also, I don't want the deployment tool to do all kind of magic (such as server proxying or auto management of releases). The great thing about Fabric is that it's really easy to understand what is going on and to do custom deployments schemes. Here is the current fabfile: #!/usr/bin/env python
import time
config.fab_hosts = ['192.168.0.50',
'192.168.0.51',
'192.168.0.49']
config.fab_mode = 'deep'
@hosts('192.168.0.50')
def deploy_test():
deploy_server()
def deploy_all():
deploy_server()
def deploy_server():
run("svn up ~/plurk/new_production")
run("sudo supervisorctl shutdown")
time.sleep(3)
for i in range(0, 3):
try:
run("sudo supervisord")
time.sleep(3)
break
except:
print 'Could not start supervisord, trying again...'
time.sleep(3)
run('ps aux | grep "plurk.scripts.server" | grep -v "grep"')
It's amazingly simple, easy to understand and hack. |
|