diff --git a/explorer/.env.dev b/explorer/.env.dev index 38728db845..ccbd316a4a 100644 --- a/explorer/.env.dev +++ b/explorer/.env.dev @@ -25,3 +25,6 @@ MAX_BATCH_SIZE=268435456 # 256 MiB # Time we wait for a batch to be verified before marking it stale BATCH_TTL_MINUTES=5 + +# Latest aligned release that operators should be running +LATEST_RELEASE=v0.13.0 diff --git a/explorer/.env.example b/explorer/.env.example index b9a3a7a32a..0733157512 100644 --- a/explorer/.env.example +++ b/explorer/.env.example @@ -23,3 +23,6 @@ TRACKER_API_URL= # Time we wait for a batch to be verified before marking it stale BATCH_TTL_MINUTES=5 + +# Latest aligned release that operators should be running +LATEST_RELEASE=v0.13.0 diff --git a/explorer/lib/explorer_web/live/releases_helper.ex b/explorer/lib/explorer_web/live/releases_helper.ex index 7a9a6db351..4f8a3eb7e7 100644 --- a/explorer/lib/explorer_web/live/releases_helper.ex +++ b/explorer/lib/explorer_web/live/releases_helper.ex @@ -2,39 +2,6 @@ defmodule ReleasesHelper do require Logger def get_latest_release do - case do_fetch_latest_release() do - {:ok, tag} -> - tag - - {:error, reason} -> - Logger.error("Failed to fetch latest release: #{reason}") - nil - end - end - - defp do_fetch_latest_release do - with :ok <- fetch_tags(), - {:ok, tag} <- get_latest_tag() do - {:ok, tag} - end - end - - defp fetch_tags do - case System.cmd("git", ["fetch", "--tags"]) do - {_, 0} -> :ok - {error, _} -> {:error, "Failed to fetch tags: #{error}"} - end - end - - defp get_latest_tag do - case System.cmd("git", ["rev-list", "--tags", "--max-count=1"]) do - {sha, 0} -> - sha = String.trim(sha) - case System.cmd("git", ["describe", "--tags", sha]) do - {tag, 0} -> {:ok, String.trim(tag)} - {_, _} -> {:error, "Failed to describe tag"} - end - {_, _} -> {:error, "No tags found or not a git repository"} - end + System.get_env("LATEST_RELEASE") end end diff --git a/explorer/start.sh b/explorer/start.sh index 1763d73149..dd49823a58 100755 --- a/explorer/start.sh +++ b/explorer/start.sh @@ -16,6 +16,7 @@ env_vars=( "TRACKER_API_URL" "MAX_BATCH_SIZE" "BATCH_TTL_MINUTES" + "LATEST_RELEASE" ) for var in "${env_vars[@]}"; do