capistrano for php site rollouts

Posted on September 23rd, 2009 in PHP by Russ

I’ve stumbled across the idea of using capistrano for rollouts. I like the idea. It’s not so good for development, though. Here’s what I mean.

On the one hand, my current setup — I make some changes to some code and test it. My testing is on another server. I update the remote server with rsync. It’s quick and painless. I probably do this about once every five to ten minutes while I’m building something. Do it, look. Do it, look. Do it, look. Then when I’m happy and it’s reached a milestone, I commit it to subversion. This is the point where the capistrano would fit in- because it checks it out from the subversion repository.

Now, after doing “cap deploy” every five minutes, I have 12 slightly different copies of the site in the releases directory. What I should have done is use rsync to push my changes to the dev server and use “deploy” only for rolling the code out to the production server– two different tasks that are only superficially the same.

Amazon Didn’t Lie

Posted on September 14th, 2009 in PHP, Uncategorized by Russ

I’ve been wondering why the feed-getting scripts on http://www.newconsolegames.com/ kept hanging and causing server problems. Seven or so of those scripts all running at once can cause that!

So I spent an hour fixing some error reporting to them. And then tested it– and what did I learn? First, I coded it using “fopen(url,r) which didn’t get me anywhere when fopen died. I didn’t do any error checking on that– so what was hanging the system was an infinite “fopen did not return a resource” in a while loop.

Second, fopen was dying because I ignored Amazon’s requirement that we start signing our AWS requests effective 8/15. … Now I have to figure out how to do that and implement it on about five sites that get amazon info and update databases! Stupid me. I could have done this better. But I was “busy!”