bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Remove post install .env copy

Open swalkinshaw opened this issue 4 years ago • 4 comments

.env.example is just an example and doesn't contain useful defaults. Copying this file can be confusing since it needs to be edited regardless. By not copying this file, we'll surface errors of missing config values sooner since they'll be no default values.

This is an alternative to https://github.com/roots/bedrock/pull/587 and https://github.com/roots/bedrock/pull/586

TODO if merged: updated roots.io docs

swalkinshaw avatar May 28 '21 03:05 swalkinshaw

I find the .env.example to be useful as a guide (like the docs currently say) as to what values are needed and have actively added to it in the past as a reference for new devs.

Also, this change would break my wp-cli valet command which replaces these defaults when creating a new Bedrock site. I'm not saying this change shouldn't happen for that reason only, but it would be nice to have some time to prepare an update before this is merged, if it goes through.

Edit: I may have misunderstood the change here – I read this as .env.example was being removed, but now I understand this is only about not copying it automatically after the initial install (as the title says 🤦‍♂️ ), in which case this should be fine 😄

aaemnnosttv avatar May 28 '21 08:05 aaemnnosttv

I like this change. I think it's great for new players to Bedrock that might not be familiar with it. Following a README that asks to explicitly copy .env.example to .env will make them away of this file from the get-go.

Jamiewarb avatar May 28 '21 08:05 Jamiewarb

Suggestion: if .env if not exists, die() with an error messge and link to roots.io/docs before https://github.com/roots/bedrock/blob/e9400200cdbdf00c97e7ad80802c48221ec7ac8d/config/application.php#L32

Similar to https://github.com/roots/sage/blob/6d66debe17dc413cd9f276ddb42a368bf0dc844d/functions.php#L15

tangrufus avatar May 29 '21 06:05 tangrufus

Suggestion: if .env if not exists, die() with an error messge and link to roots.io/docs before

https://github.com/roots/bedrock/blob/e9400200cdbdf00c97e7ad80802c48221ec7ac8d/config/application.php#L32

Similar to https://github.com/roots/sage/blob/6d66debe17dc413cd9f276ddb42a368bf0dc844d/functions.php#L15

This doesn't work for dockerized environments where the environment variables are set by the container orchestrator (Kubernetes, heroku, etc). .env should only be used if you don't have first-class environment variable management.

austinpray avatar May 29 '21 14:05 austinpray

@swalkinshaw check #674, should do the trick without hussle :)

ggiak avatar Apr 01 '23 12:04 ggiak