mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(ci): Populate elixir vsn from env at build time (#7773)
Dependabot's workflow is set up in such a way it seems that it can't find our `sha.exs` file. This is a cleaner approach that doesn't rely on using external files for the application version. Interesting note: `mix compile` will happily use the cached `version` even though it's computed from an env var, because `mix compile` uses file hash and mtime to know when to recompile. See https://github.com/firezone/firezone/network/updates/942719116
This commit is contained in:
@@ -2,11 +2,9 @@ defmodule API.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
def project do
|
||||
{sha, _} = Code.eval_file(Path.join([__DIR__, "..", "..", "sha.exs"]))
|
||||
|
||||
[
|
||||
app: :api,
|
||||
version: "0.1.0+#{sha}",
|
||||
version: version(),
|
||||
build_path: "../../_build",
|
||||
config_path: "../../config/config.exs",
|
||||
deps_path: "../../deps",
|
||||
@@ -79,4 +77,9 @@ defmodule API.MixProject do
|
||||
test: ["ecto.create --quiet", "ecto.migrate", "test"]
|
||||
]
|
||||
end
|
||||
|
||||
defp version do
|
||||
sha = System.get_env("GIT_SHA", "deadbeef") |> String.trim()
|
||||
"0.1.0+#{sha}"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user