How to create a symbol between directories in deploy PHP with Deployer?

Asked

Viewed 16 times

0

I was creating an application in Laravel, and I’m using the Deployer. This is the folder configuration file that will be the releases folder ( which are the versions of the project ) and the Current folder ( which will be the current project )

<?php
namespace Deployer;

require 'recipe/laravel.php';

// Project name
set('application', 'my_project');

// Project repository
set('repository', 'https://github.com/Genielson/lara-code.git');

// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true); 

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

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


// Hosts

host('meuacesso.host')
    ->port('minhaporta')
    ->set('writable_mode', 'chmod')
    ->set('deploy_path', '/var/www/html');    
    
// Tasks

task('build', function () {
    run('cd {{release_path}} && build');
});

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

// Migrate database before symlink new release.

//before('deploy:symlink', 'artisan:migrate');

The problem is that in shared environments with Apache, the main folder where the project should be placed is in /home/defaultwebsite/public/ and where the Deployer plays the project is in /var/www/html/. In this last path Deployer will create the Current folder and releases. My question is : How do I get this public folder to point to the Current folder? I’ve heard people say I have to create a symbolic link to this folder. Does anyone know how to do that? Or rather, can you tell me if this is really the best way to do it?

  • Why not modify the Documentroot of virtualhost Apache to point to the right location? You could also modify the folder where the deploy will be made.

  • Sorry, but I don’t have as much experience in editing the Documentroot. Could you tell me or show some tutorial doing more or less this?

  • http://devfuria.com.br/linux/apache-ajustando-documentroot/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.