From d80fdf8468380e139ef56435c2ce8420435fd07a Mon Sep 17 00:00:00 2001 From: Clint Miller Date: Mon, 18 Sep 2023 16:07:36 -0500 Subject: [PATCH] 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. --- lib/kamal/commands/app.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kamal/commands/app.rb b/lib/kamal/commands/app.rb index f3ebe567..b58861ca 100644 --- a/lib/kamal/commands/app.rb +++ b/lib/kamal/commands/app.rb @@ -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,