-
In kamal 1, having multiple destinations (default, production), I'd have something like this: # deploy.yml
servers:
web:
hosts:
- <%= ENV['SERVER_IP_ADDRESS'] %> Then in the I'm having a hard time trying to replicate this on kamal 2. If I include the I've also tried getting it from the secrets: adding # deploy.yml
servers:
web:
hosts:
- SERVER_IP_ADDRESS Yet that results with the literal string What's the right way of doing this in kamal 2? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
A couple things you could try to get around this. If using multiple destinations, you can use dedicated deploy config files for each: Like you've discovered, kamal doesn't pull from your
This way you can control what |
Beta Was this translation helpful? Give feedback.
-
I'm trying to avoid hard-coding the IPs on the deploy files
I'm not sure I follow, how should I then set the deploy.yml file for this to work? How do I 'tell' kamal that it needs to run dotenv for its other commands (deploy, redeploy, etc..) to work? |
Beta Was this translation helpful? Give feedback.
-
It was a matter of using the <% require "dotenv"; Dotenv.load(".env.production", overwrite: true) %>
... This will make .env.production keys have precedence over .env keys |
Beta Was this translation helpful? Give feedback.
It was a matter of using the
overwrite: true
option on the production config:This will make .env.production keys have precedence over .env keys