basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
9.39k stars 359 forks source link

Skip shell option value if it's nil #774

Open xiaohui-zhangxh opened 2 months ago

xiaohui-zhangxh commented 2 months ago

I think optionize shouldn't output the key which value is nil, we should treate nil as removing the key. If we need a key-only argument, the value should be true instead of nil.

eg.

production environment, we use http provider for traerik

# config/deploy.yaml
traefik:
  args:
    providers.http.endpoint: "http://app:3000/v1/traefik/routes"

development environment, we are changing http provider to file provier

# config/deploy.dev.yaml
traefik:
  args:
    providers.http.endpoint: null
    providers.file.directory: "/etc/traefik/enabled-sites"
    providers.file.watch: true