How to use php deployer?

701 views Asked by At

I want to deploy a PHP project with Deployer.
I have this code:

task('deploy', [
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:writable',
'deploy:vendors',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'cleanup',
'success'
]);

I want to deploy on a preview.domain.com and run acceptance tests.
After that I want to read the report.xml.
When everything is clear I want to link to the current folder.
How can I do that?

1

There are 1 answers

0
Oscar Garcia On

To do the deploy you have to configurate your host in the deploy.php file (in the root of your project), like:

host('domain.com')
  ->stage('production')    
  ->set('deploy_path', '/var/www/domain.com');

you can create task that you can hook after some other task, like:

task('my_task', function () {
  <code> 
});


after('deploy', 'my_task');

with this tools you can do everything

To execute the deploy use the comand:

dep deploy domain.com