I’m sure you’ve heard a lot about capistrano. It’s a very cool and handy tool. But sometime, you might not be able to meet its requirement. You have to have Ruby, and of course shell access. Well, I’m a geek trapped in the 1.0 age. You must believe me if I told you: I don’t have any shell access on my hosting provider. But I want Capistrano. For God sake, stop crying! Here some lines of PHP for your capistrano need:


// Neofreko's capistrano ;)
$date = date('Ymd');
@system("wget --mirror -nH --cut-dirs=3 -Psvn$date -o log$date --http-user meoncapistrano --http-password meoncapistrano http://trac.cz/svn/meprojectrocks/trunk");

// make link
@system("ln -s -f svn$date current");

// remove index.html
@system("rm -f current/index.html");
?>

You know you can do more with Phing, though it will be less readable than Ruby syntax :D.

What did I gain? Well, obviously, compared to doing local svn export and manually push the files via ftp, this one run blazingly faster! What can I say, it is wget-ing from ‘backbone’ to ‘backbone’. My local-to-live-server line just won’t cut it :)).

PS:
OK Rail-ers, move on, I’m not playing troll here :)

Powered by ScribeFire.

Sphere: Related Content