Skip to content

Bugfix dotenv test in laravel.php #4082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 25, 2025

Conversation

aladei-dean-lucassen
Copy link
Contributor

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.

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
Copy link
Contributor Author

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

@antonmedv
Copy link
Member

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');

@aladei-dean-lucassen
Copy link
Contributor Author

@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
Copy link
Contributor Author

@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.

@antonmedv
Copy link
Member

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

@aladei-dean-lucassen
Copy link
Contributor Author

@antonmedv just added the commit.

Change instructions for set dotenv to use release_or_current_path variable.
This reverts commit df230db, reversing
changes made to 8a92805.
@antonmedv antonmedv merged commit ac46152 into deployphp:master Jun 25, 2025
@aladei-dean-lucassen aladei-dean-lucassen deleted the patch-1 branch June 25, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants