Skip to content

Commit

Permalink
Add ubuntu 24
Browse files Browse the repository at this point in the history
  • Loading branch information
LostKobrakai committed Aug 14, 2024
1 parent d5048c8 commit 99192aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/bob_versions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ defmodule BobVersions do
: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"
end

BobVersions.EtagCachedResources.resource(url, cache_timeout: @cache_timeout)
Expand All @@ -48,6 +49,7 @@ defmodule BobVersions do
{:erlang, :ubuntu_18} -> BobVersions.BuildSetup.Erlang.Ubuntu18
{:erlang, :ubuntu_20} -> BobVersions.BuildSetup.Erlang.Ubuntu20
{:erlang, :ubuntu_22} -> BobVersions.BuildSetup.Erlang.Ubuntu22
{:erlang, :ubuntu_24} -> BobVersions.BuildSetup.Erlang.Ubuntu24
end

availability = Keyword.get(opts, :availability, &attach_availability/1)
Expand Down
13 changes: 13 additions & 0 deletions lib/bob_versions/build_setup/erlang/ubuntu.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,16 @@ defmodule BobVersions.BuildSetup.Erlang.Ubuntu22 do
"https://repo.hex.pm/builds/otp/ubuntu-22.04/#{branch}.tar.gz"
end
end

defmodule BobVersions.BuildSetup.Erlang.Ubuntu24 do
@moduledoc false
@behaviour BobVersions.BuildSetup

defdelegate group_by_version_and_sort(list), to: BobVersions.BuildSetup.Erlang
defdelegate version_from_string(ref), to: BobVersions.BuildSetup.Erlang
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"
end
end
4 changes: 3 additions & 1 deletion lib/bob_versions_web/controllers/erlang_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ defmodule BobVersionsWeb.ErlangController do
"ubuntu_16" => :ubuntu_16,
"ubuntu_18" => :ubuntu_18,
"ubuntu_20" => :ubuntu_20,
"ubuntu_22" => :ubuntu_22
"ubuntu_22" => :ubuntu_22,
"ubuntu_24" => :ubuntu_24
}
when action == :show

Expand Down Expand Up @@ -40,6 +41,7 @@ defmodule BobVersionsWeb.ErlangController do
defp distro_label(:ubuntu_18), do: "Ubuntu 18.04"
defp distro_label(:ubuntu_20), do: "Ubuntu 20.04"
defp distro_label(:ubuntu_22), do: "Ubuntu 22.04"
defp distro_label(:ubuntu_24), do: "Ubuntu 24.04"

defp valid_distro_or_404(conn, valid) do
distro = conn.params["distro"]
Expand Down
3 changes: 3 additions & 0 deletions lib/bob_versions_web/templates/page/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<.link navigate={~p"/erlang/ubuntu_22"} class="panel-block">
View packages – Ubuntu 22.04
</.link>
<.link navigate={~p"/erlang/ubuntu_24"} class="panel-block">
View packages – Ubuntu 24.04
</.link>
</article>
</div>
</div>
Expand Down

0 comments on commit 99192aa

Please sign in to comment.