Burrito keys its on-host install directory on `{release}_erts-{ertsver}_{appver}`
and skips extraction when `_metadata.json` is already present for that version.
With a static `@version "0.1.0"` in mix.exs, every new build landed in the same
cached dir on the target host — silently running stale code.
Now @version resolves to `0.1.0+<BUILD_ID>` where BUILD_ID is the git short SHA
(or `dev-<timestamp>` fallback). scripts/build-linux.sh computes it on the host
and passes it through Dockerfile.build's ARG/ENV, so every commit produces a
distinct Burrito install dir and fresh extraction is guaranteed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
60 lines
1.4 KiB
Elixir
60 lines
1.4 KiB
Elixir
defmodule ProxmoxAgent.MixProject do
|
|
use Mix.Project
|
|
|
|
@version_base "0.1.0"
|
|
|
|
def project do
|
|
[
|
|
app: :agent,
|
|
version: version(),
|
|
elixir: "~> 1.17",
|
|
start_permanent: Mix.env() == :prod,
|
|
deps: deps(),
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
|
releases: releases()
|
|
]
|
|
end
|
|
|
|
def application do
|
|
[
|
|
extra_applications: [:logger, :crypto],
|
|
mod: {ProxmoxAgent.Application, []}
|
|
]
|
|
end
|
|
|
|
# Version is built per-invocation so every commit produces a distinct Burrito
|
|
# install directory on the target host (`<release>_erts-<ertsver>_<version>`).
|
|
# Without this, Burrito sees an existing `_metadata.json` for the same version
|
|
# and skips extraction, silently running stale cached code.
|
|
defp version do
|
|
build_id = System.get_env("BUILD_ID") || "dev"
|
|
"#{@version_base}+#{build_id}"
|
|
end
|
|
|
|
defp deps do
|
|
[
|
|
{:slipstream, "~> 1.1"},
|
|
{:jason, "~> 1.4"},
|
|
{:toml, "~> 0.7"},
|
|
{:burrito, "~> 1.3"}
|
|
]
|
|
end
|
|
|
|
defp elixirc_paths(:test), do: ["lib", "test/support"]
|
|
defp elixirc_paths(_), do: ["lib"]
|
|
|
|
defp releases do
|
|
[
|
|
agent: [
|
|
steps: [:assemble, &Burrito.wrap/1],
|
|
burrito: [
|
|
targets: [
|
|
linux_amd64: [os: :linux, cpu: :x86_64],
|
|
linux_arm64: [os: :linux, cpu: :aarch64],
|
|
macos: [os: :darwin, cpu: :aarch64]
|
|
]
|
|
]
|
|
]
|
|
]
|
|
end
|
|
end
|