7 ms·
As a Django developer/sysadmin myself, I'd be very interested to hear more details about how you deploy.
by spleeyah 15y ago
As a Django developer/sysadmin myself, I'd be very interested to hear more details about how you deploy.
- jknupp 15y agoWell, 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.
- joelhaasnoot 15y agoHmm, 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.
- andrus 15y agoHow does Fabric compare to setting up a git hook on post-merge to run collectstatic, etc.?
- joelhaasnoot 15y agoNot 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 https://gist.github.com/1755101 A bunch of simple functions, some wrappers for directories and the environment, and an order of operations
- spleeyah 15y agoHave 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.
- jsvaughan 15y agoI 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.
- spleeyah 15y agoCool! 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.
- marcofucci 15y agoI 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.
- jknupp 15y agoI'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.