Skip to content

Commit

Permalink
Move to builds.hex.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
LostKobrakai committed Aug 14, 2024
1 parent 6abad1e commit 0e2e129
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions lib/bob_versions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ defmodule BobVersions do

@spec get_bob_elixir_builds_file() :: {:ok | :stale, binary} | :error
def get_bob_elixir_builds_file do
url = "https://repo.hex.pm/builds/elixir/builds.txt"
url = "https://builds.hex.pm/builds/elixir/builds.txt"
BobVersions.EtagCachedResources.resource(url, cache_timeout: @cache_timeout)
end

@spec get_bob_erlang_builds_file(:ubuntu | :alpine) :: {:ok | :stale, binary} | :error
def get_bob_erlang_builds_file(distro) do
url =
case distro do
:ubuntu_14 -> "https://repo.hex.pm/builds/otp/ubuntu-14.04/builds.txt"
:ubuntu_16 -> "https://repo.hex.pm/builds/otp/ubuntu-16.04/builds.txt"
:ubuntu_18 -> "https://repo.hex.pm/builds/otp/ubuntu-18.04/builds.txt"
:ubuntu_20 -> "https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
:ubuntu_22 -> "https://repo.hex.pm/builds/otp/ubuntu-22.04/builds.txt"
:ubuntu_24 -> "https://repo.hex.pm/builds/otp/ubuntu-24.04/builds.txt"
:ubuntu_14 -> "https://builds.hex.pm/builds/otp/ubuntu-14.04/builds.txt"
:ubuntu_16 -> "https://builds.hex.pm/builds/otp/ubuntu-16.04/builds.txt"
:ubuntu_18 -> "https://builds.hex.pm/builds/otp/ubuntu-18.04/builds.txt"
:ubuntu_20 -> "https://builds.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
:ubuntu_22 -> "https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt"
:ubuntu_24 -> "https://builds.hex.pm/builds/otp/ubuntu-24.04/builds.txt"
end

BobVersions.EtagCachedResources.resource(url, cache_timeout: @cache_timeout)
Expand Down
2 changes: 1 addition & 1 deletion lib/bob_versions/availability/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ defmodule BobVersions.Availability.Worker do
case BobVersions.Http.request(:head, {String.to_charlist(state.url), []}, [],
body_format: :binary
) do
{:ok, {{_version, 200, ~c"OK"}, _, _}} -> :available
{:ok, {{_version, 200, ~c"OK"}, _, _}} -> :available
_ -> :unavailable
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bob_versions/build_setup/elixir.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ defmodule BobVersions.BuildSetup.Elixir do
end

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/elixir/#{branch}.zip"
"https://builds.hex.pm/builds/elixir/#{branch}.zip"
end
end
12 changes: 6 additions & 6 deletions lib/bob_versions/build_setup/erlang/ubuntu.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu14 do
defdelegate github_ref_url(ref), to: BobVersions.BuildSetup.Erlang

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/otp/ubuntu-14.04/#{branch}.tar.gz"
"https://builds.hex.pm/builds/otp/ubuntu-14.04/#{branch}.tar.gz"
end
end

Expand All @@ -20,7 +20,7 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu16 do
defdelegate github_ref_url(ref), to: BobVersions.BuildSetup.Erlang

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/otp/ubuntu-16.04/#{branch}.tar.gz"
"https://builds.hex.pm/builds/otp/ubuntu-16.04/#{branch}.tar.gz"
end
end

Expand All @@ -33,7 +33,7 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu18 do
defdelegate github_ref_url(ref), to: BobVersions.BuildSetup.Erlang

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/otp/ubuntu-18.04/#{branch}.tar.gz"
"https://builds.hex.pm/builds/otp/ubuntu-18.04/#{branch}.tar.gz"
end
end

Expand All @@ -46,7 +46,7 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu20 do
defdelegate github_ref_url(ref), to: BobVersions.BuildSetup.Erlang

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/otp/ubuntu-20.04/#{branch}.tar.gz"
"https://builds.hex.pm/builds/otp/ubuntu-20.04/#{branch}.tar.gz"
end
end

Expand All @@ -59,7 +59,7 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu22 do
defdelegate github_ref_url(ref), to: BobVersions.BuildSetup.Erlang

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/otp/ubuntu-22.04/#{branch}.tar.gz"
"https://builds.hex.pm/builds/otp/ubuntu-22.04/#{branch}.tar.gz"
end
end

Expand All @@ -72,6 +72,6 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu24 do
defdelegate github_ref_url(ref), to: BobVersions.BuildSetup.Erlang

def hex_pm_download_url(branch) do
"https://repo.hex.pm/builds/otp/ubuntu-24.04/#{branch}.tar.gz"
"https://builds.hex.pm/builds/otp/ubuntu-24.04/#{branch}.tar.gz"
end
end
2 changes: 1 addition & 1 deletion lib/bob_versions/etag_cached_resources.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule BobVersions.EtagCachedResources do
## Usage
{:ok, pid} = BobVersions.EtagCachedResources.start_link()
url = "https://repo.hex.pm/builds/elixir/builds.txt"
url = "https://builds.hex.pm/builds/elixir/builds.txt"
# Downloads resource
{:ok, _} = BobVersions.EtagCachedResources.resource(url)
# Serves cached content
Expand Down
16 changes: 8 additions & 8 deletions test/bob_versions/bob_versions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule BobVersionsTest do
%{
availability: :undetermined,
checksum: "",
download: "https://repo.hex.pm/builds/elixir/v0.12.4.zip",
download: "https://builds.hex.pm/builds/elixir/v0.12.4.zip",
git: %{
sha: "543dfdeac80cfaf3483927c189cf9974f1e361eb",
url:
Expand All @@ -46,7 +46,7 @@ defmodule BobVersionsTest do
%{
availability: :undetermined,
checksum: "",
download: "https://repo.hex.pm/builds/elixir/v0.12.5.zip",
download: "https://builds.hex.pm/builds/elixir/v0.12.5.zip",
git: %{
sha: "b07fbcf8b73e9353cc336107050a8aac5fdabd11",
url:
Expand All @@ -71,7 +71,7 @@ defmodule BobVersionsTest do
%{
availability: :undetermined,
checksum: "",
download: "https://repo.hex.pm/builds/elixir/v0.13.0.zip",
download: "https://builds.hex.pm/builds/elixir/v0.13.0.zip",
git: %{
sha: "ada53524caa6ea27ffaa1a373f5c86bd6cadb0d5",
url:
Expand Down Expand Up @@ -110,7 +110,7 @@ defmodule BobVersionsTest do
availability: :undetermined,
checksum:
"950f5a6784cb556199797c6f7f0205db5c17dbbf1a7ce0aabdf575429c16c89c",
download: "https://repo.hex.pm/builds/elixir/v0.12.4.zip",
download: "https://builds.hex.pm/builds/elixir/v0.12.4.zip",
git: %{
sha: "543dfdeac80cfaf3483927c189cf9974f1e361eb",
url:
Expand All @@ -134,7 +134,7 @@ defmodule BobVersionsTest do
availability: :undetermined,
checksum:
"d11c2d82a603a1362797a181dd8c8a2a5d6d9c6e5e54cfb03e8cb96443b91828",
download: "https://repo.hex.pm/builds/elixir/v0.12.5.zip",
download: "https://builds.hex.pm/builds/elixir/v0.12.5.zip",
git: %{
sha: "b07fbcf8b73e9353cc336107050a8aac5fdabd11",
url:
Expand Down Expand Up @@ -187,7 +187,7 @@ defmodule BobVersionsTest do
%{
availability: :undetermined,
checksum: "",
download: "https://repo.hex.pm/builds/otp/ubuntu-14.04/OTP-19.2.tar.gz",
download: "https://builds.hex.pm/builds/otp/ubuntu-14.04/OTP-19.2.tar.gz",
git: %{
sha: "3473ecd83a7bbe7e0bebb865f25dddb93e3bf10f",
url:
Expand All @@ -211,7 +211,7 @@ defmodule BobVersionsTest do
availability: :undetermined,
checksum: "",
download:
"https://repo.hex.pm/builds/otp/ubuntu-14.04/OTP-19.3.6.9.tar.gz",
"https://builds.hex.pm/builds/otp/ubuntu-14.04/OTP-19.3.6.9.tar.gz",
git: %{
sha: "3d0c4930775cf2ab304d5e4701b41ffc2936ce53",
url:
Expand All @@ -236,7 +236,7 @@ defmodule BobVersionsTest do
%{
availability: :undetermined,
checksum: "",
download: "https://repo.hex.pm/builds/otp/ubuntu-14.04/OTP-20.0.tar.gz",
download: "https://builds.hex.pm/builds/otp/ubuntu-14.04/OTP-20.0.tar.gz",
git: %{
sha: "040bdce67f88d833bfb59adae130a4ffb4c180f0",
url:
Expand Down

0 comments on commit 0e2e129

Please sign in to comment.