-
Notifications
You must be signed in to change notification settings - Fork 86
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
Seems like Forge overrides environment configuration after site has been installed #105
Comments
Sorry, accidentally pressed enter.. my bad.. |
@driesvints I've updated the title and description |
@dees040 thanks for reporting this. You're right in your thinking that Forge will automatically create a default It's not possible to write the Environment file before the project is installed. Does this clarify things? |
@jbrooksuk That clarifies it! Thank you very much. Two questions which pop up for me.
|
|
@jbrooksuk this should be mentioned in the documentation! |
Description:
I’m automatically creating a site (
createSite()
), installing git (installGitRepository()
), creating a database (createDatabase()
) and setting all the environment variables (updateSiteEnvironmentFile()
). I perform the API requests in this order as well, but I check if the site status, git status and database status is correct before going to the next step. When coming to the last step I retrieve the default content of the environment file usingsiteEnvironmentFile()
. Then, I change the variables which need to change. At last, I update the env file usingupdateSiteEnvironmentFile()
.Now if I go to the site on Forge and check the Environment tab, I see the original/default content of the env file. It seems/feels like Forge updates the env file one more time with the default content right after everything is installed. A few things which come to mind: maybe I’m updating the
.env
file too fast or maybe the.env
file is not created yet? But this is a wild guess. If I execute the exact same code after (let’s say) 30 seconds, it does work. That’s why I think Forge updates/overrides it.The code for updating the env file:
So if you check what the dump outputs on the last line, it seems like the content which is sent to the API is correct.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: