views:

81

answers:

2

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.

A: 

Is git archive <release-branch> | tar -x -C /path/to/live/site really something you need a tool for?

Amber
Despite the (presumed?) snarkiness, thanks for the info. I'm primarily a front-end developer with only a moderate level of skill in system administration so I'm having to pull a lot of this stuff together very quickly.
Geuis
Sorry, no snarkiness intended; I just wasn't really paying attention to my phrasing late at night. :)
Amber
+1  A: 

There's a couple of options:

  1. 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.

  2. 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.

shazow
I was reading up on fabric a few hours ago. I'll take a closer look tomorrow. Thanks.
Geuis