Skip to content

Sorted keys breaks variable dependence in the envfile #50

@danielporto

Description

@danielporto

I've observed that the keys on the generated env file are sorted.
However it breaks some variables that uses other variables in the env file.
For instance:
suppose a variable name DOMAIN_NAME=example.com
envkey_DOMAIN_NAME: 'example.com'
followed by another one such as BAR_HOST_FQDN=bar.${DOMAIN_NAME}.
envkey_BAR_HOST_FQDN: "bar.${DOMAIN_NAME}"

the original env file is created such as
DOMAIN_NAME=example.com
BAR_HOST_FQDN=bar.${DOMAIN_NAME}

But the resulting translated env file is:
BAR_HOST_FQDN=bar.${DOMAIN_NAME}
DOMAIN_NAME=example.com

However, DOMAIN_NAME is not defined by the time BAR_HOST_FQDN is evaluated resulting in:
BAR_HOST_FQDN: bar
DOMAIN_NAME: example.com

which is different from the produced in the original env file:
BAR_HOST_FQDN: bar.example.com
DOMAIN_NAME: example.com

This doesn't seem to be much but it broke several large env files I have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions