symfony-docs icon indicating copy to clipboard operation
symfony-docs copied to clipboard

Update configuration.rst and deployment.rst for dotenv:dump command

Open mertingen opened this issue 3 years ago • 5 comments

It changes from "composer dump-env prod" to "php bin/console dotenv:dump prod"

mertingen avatar Jan 19 '22 16:01 mertingen

Hi!

This command is a bit special, as we need to register it first (see the PR description in https://github.com/symfony/symfony/pull/42610#issue-973109927):

The command is not registered by default. In order to enable it, one must add it to their services.yaml file:

services:
    Symfony\Component\Dotenv\Command\DotenvDumpCommand:
        - '%kernel.project_dir%/.env'
        - '%kernel.environment%'

I think we should document this only once, in the configuration article. And then in the deployments article, we should only add a small tip like: "If Composer is not available during deployment, you can also use the dotenv:dump command. Read ... for more information."

wouterj avatar Jan 19 '22 16:01 wouterj

Hi,

If I get the PR description without changing it and put it into the configuration documentation directly, do you mind? Because it is really good enough explicit.

I'll add the following tip in the deployment but how can I handle "read ... for more information"? Should I give the "configuration" page URL directly there?

"If Composer is not available during deployment, you can also use the dotenv:dump command. Read ... for more information."

mertingen avatar Jan 19 '22 17:01 mertingen

If I get the PR description without changing it and put it into the configuration documentation directly, do you mind? Because it is really good enough explicit.

Fine by me (I would replace "one must" with "you must" though).

I'll add the following tip in the deployment but how can I handle "read ... for more information"? Should I give the "configuration" page URL directly there?

You can use :ref:`configuration-env-var-in-prod` to link directly to the correct section in the configuration page.

wouterj avatar Jan 20 '22 14:01 wouterj

hi @wouterj

Thanks for the answer. I have got a quick question regarding deployment.rst. We edited it like the image.

43434

Should we add composer tip here? Because we already recommend using dotenv command for dumping.

mertingen avatar Jan 20 '22 23:01 mertingen

I think we can keep composer at first, and then reference the configuration section to say "if you don't have composer, use this command". Anyway, feel free to update the PR as you like it best. We can apply little reorganizations during the merge, if we think something else is better.

wouterj avatar Jan 25 '22 13:01 wouterj

Mert, thanks for this contribution! While merging I did the final change asked by Wouter (see https://github.com/symfony/symfony-docs/commit/679be09e566e61f8287f00648c10722d650b9838)

javiereguiluz avatar Jul 13 '23 15:07 javiereguiluz

Brilliant! Thank you actually.

mertingen avatar Jul 14 '23 07:07 mertingen