Hacker News new | ask | show | jobs
by jknupp 5241 days ago
Well, like it says in the post, my root directory served by Apache is just a clone of my git master branch. When I've finished making changes and committed them to master, deployment is a simple "git pull" and Apache reload via postinstall hook. Sometimes migrations need to be run, but they're all staged via another postinstall hook.
2 comments

Hmm, have you actually got everything working that way? I've found there's a few too many tasks to do that way, and wrote a Fabric script to deploy. It pulls git, checks for dependencies with a requirements file, compiles translations, runs collectstatic to put static files in the right places, and reloads Apache (and could run tests). Works quite well.
How does Fabric compare to setting up a git hook on post-merge to run collectstatic, etc.?
Not too big a fan of git hooks, but mostly because I haven't played around with them too much. My script is here: https://gist.github.com/1755101 A bunch of simple functions, some wrappers for directories and the environment, and an order of operations
Have you looked into things like Fabric for automating installations like this? It sounds like you're only deploying to one (or a few) machines, or is it more?

This part of the development cycle has always interested me, especially to see how other people do things.

I use Fabric for my deploys. The process is something like:

* Check out to clean directory

* Run tests

* Zip source

* Upload

* Unzip

* Backup existing (in case of needing rollback)

* Deploy static files

* Run South db migrations

* Restart

It's very easy to get started with Fabric and once you're using it, everything can easily be automated.

I use fabric as well with your same approach but I sometimes find easier to have git installed on the server and just pull from the main repository. I also use fabric for nginx and Apache config files so that I keep track of the changes and replace the files on the server if needed. And finally, I use fabric again to install needed virtualenv requirements.
Cool! I use Puppet at work currently to do deployment stuff, but I've always been curious about other technologies like Fabric, et al. I'll probably look into them for personal projects or just for fun, eventually. It's on my [long and growing] list of things-to-do.
I've looked at Fabric but decided that, for now, it's a bit heavyweight for my needs since I'm only deploying to one machine. If my deployments get more complicated, I'll definitely take another look.