capistrano / laravel

Gem for deploying Laravel projects with capistrano v3.*
MIT License
222 stars 71 forks source link

changes if your site isn't actually in the root of the git repo #46

Closed armyofda12mnkeys closed 4 years ago

armyofda12mnkeys commented 6 years ago

The git structure at my company makes the laravel website under directory a subfolder under git like so:

+site
  app/
  artisan
  bootstrap/
  etc
+docs
+ide_lint_setup

but alot things will then fail like 'composer install --no-dev' needs to run from the site/ directory. same for things like 'php artisan migrate', or setting up of the sym-links to the shared files/directories. Is there something currently can do to alleviate this?

For another capistrano-like deploy system (Deployer.org), I setup a custom task to temporarily change the release_path variable before the laravel specific tasks (to something like releases/#/site/ ) and then changed it back at the end to the original main path so the sym-link to the main releases/# could be setup. For example in Deployer.org, i did this: after('deploy:update_code', 'change_to_custom_site_dir'); //changed the release_path temporary before('deploy:symlink', 'change_to_original_release_dir');//changed back to orig release_path The other solution was ugly. For each task I could cd into that custom dir. But that would mean i copy 9 or so default/defined task's code into my code just to add a cd command to the top of it. Lots of code just to change a directory for each task (and i would override and therefore not get any updates to those default tasks).

Not sure if a temporary solution like above can be setup (and if so, before/after which tasks?). Or a more permanent solution where you can specify a custom variable for release_site_path where certain command/tasks cd into before doing their things.

ikari7789 commented 6 years ago

As for the shared directories, overriding the following should accomplish that: :laravel_4_linked_dirs, :laravel_5_linked_dirs, :laravel_4_acl_paths, and :laravel_4_acl_paths. Though, for the .env file and artisan commands, we'd have to extract those out to become variables for the paths. Right now they expect the project directory to be the top dir.

Obviously, you can ignore laravel_4_* variables if you're using Laravel 5.0+

ikari7789 commented 4 years ago

Not sure if this is an issue that I can handle at the moment with Capistrano (I don't know if we can temporarily override the root directory, etc). A lot of this should be able to be overcome by playing around with the various configuration values already provided by both capistrano/laravel and capistrano/composer. Unfortunately, supporting non-standard repository layouts, such as yours, are low on the list of priorities to provide support for. Is there any way you could change the repository layout?