0

I using a deployer to deploy my Laravel project. like below

<?php
namespace Deployer;

require 'recipe/laravel.php';

// Project repository
set('repository', 'git@mygit.git');

// Shared files/dirs between deploys 
add('shared_files', []);
add('shared_dirs', []);

// Writable dirs by web server 
add('writable_dirs', []);

// copy relies
add('copy_dirs', ['node_modules', 'vendor']);
before('deploy:vendors', 'deploy:copy_dirs');

// Hosts
host('ip')
    ->user('www-data')
    ->identityFile('~/.ssh/id_rsa')
    ->set('deploy_path', '/var/www/example.com.deploy');

// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

// Migrate database before symlink new release.
before('deploy:symlink', 'artisan:migrate');

But the deployer will deploy the code from main branch, what I want is delpoying the code of latest release branch.

How can I do this? I read the document, but nothing helps. Thanks a lot!

DengSihan
  • 2,119
  • 1
  • 13
  • 40
  • See [`dep help deploy`](https://deployer.org/docs/cli.html), there's a `--branch` option. See also https://deployer.org/docs/configuration.html#branch – Phil Jan 21 '21 at 06:29
  • 1
    You can also set the branch per-host configuration ~ https://deployer.org/docs/hosts.html#overriding-config-per-host. I've never even seen this tool before, I just searched for "branch" in the documentation site – Phil Jan 21 '21 at 06:31

0 Answers0