herokuish: Problem parsing .env file ?

Clone the java-getting-started app:

$ git clone https://github.com/heroku/java-getting-started.git
Cloning into 'java-getting-started'...
remote: Counting objects: 184, done.
remote: Total 184 (delta 0), reused 0 (delta 0), pack-reused 184
Receiving objects: 100% (184/184), 81.08 KiB | 0 bytes/s, done.
Resolving deltas: 100% (53/53), done.
Checking connectivity... done.

test it:

$ docker run --rm -v `pwd`/java-getting-started:/tmp/app gliderlabs/herokuish /bin/herokuish test
::: BUILDING APP :::
/app/.env: line 1: GeV: command not found

I guess, this is due to the fact, that the .env file contains a space in its value:

ENERGY=20 GeV

Indeed, when I quote the value, I can go further into the build:

ENERGY="20 GeV"

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I just saw #195

I do have pushed this issue too hard after all 😃

I changed my mind on this.

I realized that herokuish is not (required to be) Heroku, and as so, Dokku take for granted that .env file is shell source-able.

I vote you revert 465bbe14c9c2d144044a1ecb37572101133f3858, instead of trying to code a key=value parser (that supports complex shell syntax and variable interpolation) in shell 😃

And, for my original issue (being able to build the official unmodified java-getting-started), the workaround will be to simply rm the .env file; indeed, on the Heroku build servers, the .env file is not used, because it should not be under source control anyways.

Does it make sens ?

Ah that is for tests, hence why it’s in the Dockerfile.dev.

@michaelshobbs @progrium thoughts on including that in the base image, or replacing the usage in tests for something is in the base image?

@pierredavidbelanger v0.3.20 has a basic (emphasis on basic) env file parser that will work with spaces. please give it shot.

Notice I didn’t say “official”…

Oh, indeed.

Well… I guess, for a clean fix, one need to parse the .env file as key=value entries instead of plain sourceing it.

Unfortunately, I am not very good with bash nor regepx 😉

I will think about this.

Thank you for your time 😃