News for hackers. Stuff that matters.
Re:Deploy a website using git in Ubuntu by mappu on Tuesday June 05, 2012 @12:11AM (#4067287)
Is git push atomic? I'm reaching the point with a PHP application where enough people are using it at any one point, every time i push an update (using lftp --mirror over sftp) someone gets caught in the crossfire.

My next step is deploying to a temporary folder and swapping symlinks around, but if git/hg can do an atomic update that would be much simpler.

Re:Deploy a website using git in Ubuntu by pyre on Tuesday June 05, 2012 @12:29AM (#4067325)
I do not believe that checking out all files in a repository is supposed to be a single atomic action in either git or hg.
Re:Deploy a website using git in Ubuntu by mappu on Tuesday June 05, 2012 @02:49AM (#4067652)
I didn't think so. Thanks for the clarification.
Re:Deploy a website using git in Ubuntu by kijin on Tuesday June 05, 2012 @04:31AM (#4067895)
If you have APC (which you should), you can turn off apc.stat to make PHP ignore changes to actual files and keep serving scripts from the (now stale) opcode cache. Depending on the structure of your app, this might be good enough to keep things running smoothly during the second or two that it takes for git to update the working tree. When you're done, atomically clear the opcode cache. Turning off apc.stat also helps your pages load faster.
Re:Deploy a website using git in Ubuntu by saurik on Tuesday June 05, 2012 @12:26PM (#4069312)
No. In fact, git doesn't even swap individual files atomically (which is what I had expected it to do): during updates the files momentarily disappear, which caused serious issues for my site and made me move back to rsync deployment recently (which has the other security advantage of not keeping the entire history of the website on the edge servers).
Re:Deploy a website using git in Ubuntu by nimrody on Tuesday June 05, 2012 @02:12PM (#4069933)
Using symlinks is the way Capistrano does it and has the benefit of being both atomic and easy/quick to revert if something goes wrong.

There's no way git checkout can be atomic.