feat(backend): build identity в health, VERSION bake и auto stage по sha-*
CI / test (push) Successful in 28m3s

This commit is contained in:
2026-07-14 21:25:40 +03:00
parent ff4ab23264
commit 2eeda5c4c4
8 changed files with 99 additions and 31 deletions
+29
View File
@@ -0,0 +1,29 @@
-module(eventhub_build_info).
-export([info/0, version/0, git_sha/0, built_at/0]).
%% @doc Runtime build identity from env (baked at image build or set in compose).
-spec info() -> map().
info() ->
#{
status => <<"ok">>,
service => <<"eventhub">>,
version => version(),
git_sha => git_sha(),
built_at => built_at()
}.
-spec version() -> binary().
version() -> env("EVENTHUB_VERSION", <<"0.0">>).
-spec git_sha() -> binary().
git_sha() -> env("EVENTHUB_GIT_SHA", <<"unknown">>).
-spec built_at() -> binary().
built_at() -> env("EVENTHUB_BUILT_AT", <<"">>).
env(Name, Default) ->
case os:getenv(Name) of
false -> Default;
[] -> Default;
Value -> unicode:characters_to_binary(Value)
end.