Skip to content

Commit 9a4b37b

Browse files
klaus993MarcosNicolauJuArce
authored
hotfix(explorer): fetch latest version from env instead of github (#1738)
Co-authored-by: nicolau <marcosnicolau2003@gmail.com> Co-authored-by: Julian Arce <52429267+JuArce@users.noreply.github.com>
1 parent 36b5f3b commit 9a4b37b

4 files changed

Lines changed: 8 additions & 34 deletions

File tree

explorer/.env.dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ MAX_BATCH_SIZE=268435456 # 256 MiB
2525

2626
# Time we wait for a batch to be verified before marking it stale
2727
BATCH_TTL_MINUTES=5
28+
29+
# Latest aligned release that operators should be running
30+
LATEST_RELEASE=v0.13.0

explorer/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ TRACKER_API_URL=<tracker_api_url>
2323

2424
# Time we wait for a batch to be verified before marking it stale
2525
BATCH_TTL_MINUTES=5
26+
27+
# Latest aligned release that operators should be running
28+
LATEST_RELEASE=v0.13.0

explorer/lib/explorer_web/live/releases_helper.ex

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,6 @@ defmodule ReleasesHelper do
22
require Logger
33

44
def get_latest_release do
5-
case do_fetch_latest_release() do
6-
{:ok, tag} ->
7-
tag
8-
9-
{:error, reason} ->
10-
Logger.error("Failed to fetch latest release: #{reason}")
11-
nil
12-
end
13-
end
14-
15-
defp do_fetch_latest_release do
16-
with :ok <- fetch_tags(),
17-
{:ok, tag} <- get_latest_tag() do
18-
{:ok, tag}
19-
end
20-
end
21-
22-
defp fetch_tags do
23-
case System.cmd("git", ["fetch", "--tags"]) do
24-
{_, 0} -> :ok
25-
{error, _} -> {:error, "Failed to fetch tags: #{error}"}
26-
end
27-
end
28-
29-
defp get_latest_tag do
30-
case System.cmd("git", ["rev-list", "--tags", "--max-count=1"]) do
31-
{sha, 0} ->
32-
sha = String.trim(sha)
33-
case System.cmd("git", ["describe", "--tags", sha]) do
34-
{tag, 0} -> {:ok, String.trim(tag)}
35-
{_, _} -> {:error, "Failed to describe tag"}
36-
end
37-
{_, _} -> {:error, "No tags found or not a git repository"}
38-
end
5+
System.get_env("LATEST_RELEASE")
396
end
407
end

explorer/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env_vars=(
1616
"TRACKER_API_URL"
1717
"MAX_BATCH_SIZE"
1818
"BATCH_TTL_MINUTES"
19+
"LATEST_RELEASE"
1920
)
2021

2122
for var in "${env_vars[@]}"; do

0 commit comments

Comments
 (0)