Closed jwald1 closed 4 months ago
I'm not seeing that myself - are you running the latest version of Kamal?
You could double-check by comparing the output of kamal app exec -i env | sort
and kamal app exec -i --reuse env | sort
.
If you run the non-interactive version on the primary host you'll be able to see the docker run command being run: kamal app exec -p env | sort
. I'd expect to see the env variables being passed as part of that.
After upgrading to the latest version 1.5.2, the problem was fixed. Although I deploy with GitHub Actions, I run rails c
from my Mac. Hence, I didn't realize I was still using an old version (1.4). Thanks, @djmb.
Ah great!
BTW you can set minimum_version: 1.5.2
in your deploy.yml file to ensure that it doesn't regress.
I attempted to run the command
kamal app exec -i 'bin/rails c'
, but I noticed that the clear environment variables returned nilENV["CLEAR_VAR"] => nil
, while the secret environment variables were accessible. However, when I added the--reuse
option to the command, like this:kamal app exec -i --reuse 'bin/rails c'
, I was able to access the clear environment variables.