Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN support for php Deployer

I am unable to find the documentation on how to set it up with SVN. Am I missing something? I have tried in my deploy.php file:

require 'recipe/common.php';
server('ec2', 'server')
    ->user('user')
    ->pemFile('key.pem')
    ->env('deploy_path', '/var/www/website'); 
set('repository', 'http://user:[email protected]/repos/branches/development/');

I think that that is looking for a git file though. Can you help please?

Many thanks!

like image 460
Adam Avatar asked Aug 01 '26 06:08

Adam


1 Answers

Overriding tasks is quite easy. Here, is a sample of deploy.php to use svn export functionality to achieve deployment from svn repository:

//Set svn specific variables
set('svnrepo', 'http://x.x.x.x/repos/branches/development/');
set('svnuser', 'user');
set('svnpass', 'password');

/**
 * Update project code, override git, use svn instead.
 */
task('deploy:update_code', function () {
    $svn = '/usr/bin/svn';
    $repository = trim(get('svnrepo'));
    $user = trim(get('svnuser'));
    $pass = trim(get('svnpass'));
    run("$svn export --force --username $user --password $pass $repository {{release_path}} 2>&1");
})->desc('Updating code');

Also it could be written as svn up command, but in my personal opinion, who needs .svn files in prod environments?

like image 111
Vaidas Avatar answered Aug 04 '26 01:08

Vaidas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!