Friday, March 4, 2011

Manage Your Code Deployment: Subversion To Web Server In One Click

Here's the simplest way to push a folder out of your repository onto your web server for testing.

<?php
$result = array();
$command  = 'svn export ';
$command .= 'https://your_server/svn/project /path/to/www ';
$command .= '--username USER --password PASS --force ';
$command .= '--non-interactive --trust-server-cert';
exec($command, $result);
print_r($result);
?>

- Host name HAS to match certificate (where I have "your_server")
- check .htaccess files, mod rewrite, ensure permissions are 755 and www-data is owner
- Version # can be forced with -r switch (svn -r 5 export ...)

No comments:

Post a Comment