Skip to content

Commit

Permalink
Pass KAMAL_VERSION env var to container run
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clintmiller authored Sep 18, 2023
1 parent 90fefc4 commit d80fdf8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/kamal/commands/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def run(hostname: nil)
"--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,
Expand Down

0 comments on commit d80fdf8

Please sign in to comment.