Pass KAMAL_VERSION env var to container run

In lieu of a general purpose mechanism to pass dynamically-evaluated env-vars at container execution time, we can pass the `config.version` as KAMAL_VERSION to avoid having to take apart the container name just to determine the SHA of the deployed version in the entrypoint.
This commit is contained in:
Clint Miller
2023-09-18 16:07:36 -05:00
committed by GitHub
parent 90fefc419f
commit d80fdf8468

View File

@@ -18,6 +18,7 @@ class Kamal::Commands::App < Kamal::Commands::Base
"--name", container_name,
*(["--hostname", hostname] if hostname),
"-e", "KAMAL_CONTAINER_NAME=\"#{container_name}\"",
"-e", "KAMAL_VERSION=\"#{config.version}\"",
*role_config.env_args,
*role_config.health_check_args,
*config.logging_args,