开发者

Best solutions to deploy from git to production? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

开发者_如何学Go Improve this question

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:

  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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜