You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
config:push with .env does not support multline #291
@sstarcher can you show an example of a multiline env variable? from the dotenv docs, you can double-quote multiline strings and use literal \n to separate lines:
I just tested adding a double quote to the .env file that was spit out by deis config:pull, it acts the same was as if no quotes exist and for each line of the multiline string it outputs the line and "does not match the pattern 'key=var', ex: MODE=test"
When the same multiline with double quote is done on the command line it works correctly.
@sstarcher are you able to provide a couple quick examples of what you're seeing from deis config:pull and the same thing failing for deis config:push?
When I refer to Deis I'm referring to the platform version installed. All of the below is using deis client 1.10.0
In Deis 1.10.0 On the command line the following has the expected result of setting a multiline variable. Although it does complain does not match the pattern 'key=var', ex: MODE=test Creating config... ...
deis config:set HEALTHCHECK_INITIAL_DELAY=60 DERPY="HELLO
dquote> world how
dquote> are you" -a app
'DERPY=HELLO
world how
are you' does not match the pattern 'key=var', ex: MODE=test
Creating config... done
=== app Config
HEALTHCHECK_INITIAL_DELAY 60
HEALTHCHECK_TIMEOUT 300
HEALTHCHECK_URL /
After doing the above everything finishes correct, but when I do a deis config:pull or a deis config:list I don't see DERPY listed at all. This previously functioned with Deis 1.9.0.
On my Deis 1.9.0 system I have working multi line variables that show up when doing a deis config:list, but when I try to add new one's using the deis client 1.10.0 it no longer works and the added variables don't show up in deis config:list
If I downgrade the deis client to 1.9.0 deis config:set with a multiline variable works and deis config:list shows the multiline variable.
If a multiline variable is set using deis client 1.9.0 and I do deis config:pull and deis config:push I get errors. If I go into the .env file that was created and quote the multline string it still does not function.
This is a bug with the new go client. I didn't consider multi line variables when writing and they're not properly handled. You can see the file here. Allowing multi line variables with config:set should be as simple as fixing the regex. Multi line config variables with config:pull will be more difficult as the client currently parses the config file by iterating over newlines.
I'm not sure what the best approach for solving multi line config:push is, as newlines are used a separators for variables. How can you tell when a newline is part of a multi line config variable and not a config variable separator?
Could you take the naive approach and assume if you pass it through your regex and it does not match var=value than it goes with the previous variable?
Activity
deis-admin commentedon Jan 19, 2017
From @benwilber on September 19, 2015 19:27
@sstarcher can you show an example of a multiline env variable? from the dotenv docs, you can double-quote multiline strings and use literal
\nto separate lines:FOO="bar\nbaz"Or are you saying that this is what doesn't work?
deis-admin commentedon Jan 19, 2017
From @sstarcher on September 19, 2015 21:35
@benwilber it seems that deis config:pull was not double quoting the multiline string.
deis-admin commentedon Jan 19, 2017
From @sstarcher on September 19, 2015 23:48
I just tested adding a double quote to the .env file that was spit out by deis config:pull, it acts the same was as if no quotes exist and for each line of the multiline string it outputs the line and "does not match the pattern 'key=var', ex: MODE=test"
When the same multiline with double quote is done on the command line it works correctly.
deis-admin commentedon Jan 19, 2017
From @benwilber on September 20, 2015 0:1
@sstarcher are you able to provide a couple quick examples of what you're seeing from
deis config:pulland the same thing failing fordeis config:push?deis-admin commentedon Jan 19, 2017
From @sstarcher on September 20, 2015 0:42
When I refer to Deis I'm referring to the platform version installed. All of the below is using deis client 1.10.0
In Deis 1.10.0 On the command line the following has the expected result of setting a multiline variable. Although it does complain
does not match the pattern 'key=var', ex: MODE=test Creating config... ...After doing the above everything finishes correct, but when I do a deis config:pull or a deis config:list I don't see DERPY listed at all. This previously functioned with Deis 1.9.0.
On my Deis 1.9.0 system I have working multi line variables that show up when doing a deis config:list, but when I try to add new one's using the deis client 1.10.0 it no longer works and the added variables don't show up in deis config:list
A deis config:pull on the old platform produces
Which is not double quoted.
deis-admin commentedon Jan 19, 2017
From @sstarcher on September 20, 2015 1:37
If I downgrade the deis client to 1.9.0 deis config:set with a multiline variable works and deis config:list shows the multiline variable.
If a multiline variable is set using deis client 1.9.0 and I do deis config:pull and deis config:push I get errors. If I go into the .env file that was created and quote the multline string it still does not function.
deis-admin commentedon Jan 19, 2017
From @Joshua-Anderson on September 20, 2015 2:30
This is a bug with the new go client. I didn't consider multi line variables when writing and they're not properly handled. You can see the file here. Allowing multi line variables with
config:setshould be as simple as fixing the regex. Multi line config variables withconfig:pullwill be more difficult as the client currently parses the config file by iterating over newlines.deis-admin commentedon Jan 19, 2017
From @Joshua-Anderson on September 20, 2015 3:2
I fixed the
issue in #4513.
I'm not sure what the best approach for solving multi line
config:pushis, as newlines are used a separators for variables. How can you tell when a newline is part of a multi line config variable and not a config variable separator?deis-admin commentedon Jan 19, 2017
From @sstarcher on September 20, 2015 14:41
Could you take the naive approach and assume if you pass it through your regex and it does not match var=value than it goes with the previous variable?
deis-admin commentedon Jan 19, 2017
From @bacongobbler on June 18, 2016 6:39
this is still relevant for v2. I propose we should move to a more formal library such as https://github.com/joho/godotenv for parsing .env files.
Cryptophobia commentedon Mar 21, 2018
This issue was moved to teamhephy/workflow-cli#11