deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Bugfix dotenv test in laravel.php

Open aladei-dean-lucassen opened this issue 5 months ago • 3 comments

The test to check if .env file is present was not checking if the dotenv variable was set and always used the default. Added getter for dotenv variable.

aladei-dean-lucassen avatar Jun 13 '25 07:06 aladei-dean-lucassen

@antonmedv as discussed in #4081 I created a pr for the bug in the laravel recipe for checking the .env file's presence.

aladei-dean-lucassen avatar Jun 13 '25 07:06 aladei-dean-lucassen

I think we also need to change dotenv itself, so it works during deploy:

-set('dotenv', '{{current_path}}/.env');
+set('dotenv', '{{release_or_current_path}}/.env');

antonmedv avatar Jun 13 '25 09:06 antonmedv

@antonmedv where should this be added? I cannot find any occurrence of the set('dotenv', '{{current_path}}/.env'); other than a comment on line 78 in the common recipe.

aladei-dean-lucassen avatar Jun 17 '25 07:06 aladei-dean-lucassen

@antonmedv I'm happy to help but could you point me in the right direction? As stated in my previous comment I cannot find the line of code you shared besides a comment.

@antonmedv where should this be added? I cannot find any occurrence of the set('dotenv', '{{current_path}}/.env'); other than a comment on line 78 in the common recipe.

aladei-dean-lucassen avatar Jun 24 '25 09:06 aladei-dean-lucassen

This code: https://deployer.org/docs/8.x/recipe/common#dotenv

antonmedv avatar Jun 24 '25 14:06 antonmedv

@antonmedv just added the commit.

aladei-dean-lucassen avatar Jun 25 '25 07:06 aladei-dean-lucassen