dunner icon indicating copy to clipboard operation
dunner copied to clipboard

Dunner envs not working

Open apoorvam opened this issue 6 years ago • 3 comments

With latest master, try :

commands:
      - ["echo","$FOO_USER"]
      - ["echo", "$BUILD_DIR"]
envs:
      - FOO_USER=foo
      - BUILD_DIR=`$GOPATH`

Environment variables are not passed to container. The commands above do not print passed values.

apoorvam avatar Jun 25 '19 12:06 apoorvam

Use printenv command to check if environment variables are set or not. I did. Actually, the problem is the command here is being executed as echo "$FOO_USER", which will have output $FOO_USER and not foo. But if you use $FOO_USER inside a bash script and copy it inside the container, it might work correctly.

ayushjn20 avatar Jun 28 '19 09:06 ayushjn20

Okay, I tried with printenv. So its being set correctly.

But this is also a usecase that should work with echo. Do you think we can address it with some change?

apoorvam avatar Jun 28 '19 09:06 apoorvam

Try this!

- [sh, -c, "echo $FOO_USER"]

Reference

ayushjn20 avatar Aug 06 '19 04:08 ayushjn20