mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.34k stars 491 forks source link

Better support for CLI variables #675

Open lovro-bikic opened 2 years ago

lovro-bikic commented 2 years ago

Mina has a feature which allows overriding variables (set using set method) with environment variables, e.g. rails_env=production mina deploy will override rails_env variable set in config/deploy.rb. While this is a useful feature, it also causes unexpected issues.

For example, one variable Mina uses is called user. Windows environments have a USER environment variable, however, since they're case-insensitive, it can be accessed as lowercase user, so it will override a Mina-set user variable.

Instead of environment variables, we should find another way of supporting variables through CLI. One of the proposed solutions is to take an approach similar to that of docker run command, which accepts variables as an option (see docs). The above example command would then look like this: mina deploy --env rails_env=production.