My cofounder and I are setting up our server for our startup. We're using git for our source control and the project is django sitting behind nginx via fcgi on Ubuntu. Since we're just getting started, and to make deployments easy on both of us, I have in mind to have a simple deploy script living on the server that will automatically pull in the latest code changes from git and then deploy them.
I know I can manually write a bash or python script that will do this, but I was hoping to first find out if there are other relatively easy to use software solutions that I can just tie into. At this stage, we have little interest in continuous deploy yet but I'm thinking there might be some packages in that domain that could be useful to us.
There's a couple of options:
Hosting a git repository on the server to push to, which automagically checks out the latest version. More on this here, also check out this detached git tree solution, too.
Use something like fabric with rsync
or similar.
Typically I would have an inline git repo with the post-update hook setup for a specific branch (usually "live"). Then it's a matter of git remote add -t live live ssh://...
on my laptop and a git push live
to get things pushed. You'll also need something to restart the Django server for the new code to take effect (could do this inside the hook, or ssh/fabric).
For future projects, I'm experimenting with the detached git tree (seems more elegant) combined with fabric.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With