Skip to content

Commit 378538d

Browse files
madlepkappiah
andauthored
Use new build hex pm urls (#214)
* Follow redirects to repo.hex.pm * use builds.hex.pm URLs rather than deprecated repo.hex.pm URLs From https://hex.pm/blog/new-domain-for-build-artifacts Currently the curl calls aren't causing redirects to be followed. So the calls to `fetch_elixir_versions` and `fetch_erlang_versions` silently fail, and return no data, resulting in "Sorry, Erlang version isn't supported yet" error. Could follow redirects, but better fix is to update to use new URLs --------- Co-authored-by: Kwasi Appiah <[email protected]>
1 parent 7de21d0 commit 378538d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
* Erlang - Prebuilt packages (17.5, 17.4, etc)
1717
* The full list of prebuilt packages can be found here:
18-
* gigalixir-20 or heroku-20 stacks: https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt
19-
* heroku-22 stacks: https://repo.hex.pm/builds/otp/ubuntu-22.04/builds.txt
18+
* gigalixir-20 or heroku-20 stacks: https://builds.hex.pm/builds/otp/ubuntu-20.04/builds.txt
19+
* heroku-22 stacks: https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt
2020
* All other stacks: https://github.com/HashNuke/heroku-buildpack-elixir-otp-builds/blob/master/otp-versions
2121
* Elixir - Prebuilt releases (1.0.4, 1.0.3, etc) or prebuilt branches (master, v1.7, etc)
2222
* The full list of releases can be found here: https://github.com/elixir-lang/elixir/releases

lib/canonical_version.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
erlang_builds_url() {
44
case "${STACK}" in
55
"heroku-20")
6-
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-20.04"
6+
erlang_builds_url="https://builds.hex.pm/builds/otp/ubuntu-20.04"
77
;;
88
"heroku-22")
9-
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-22.04"
9+
erlang_builds_url="https://builds.hex.pm/builds/otp/ubuntu-22.04"
1010
;;
1111
*)
1212
erlang_builds_url="https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14"
@@ -16,18 +16,18 @@ erlang_builds_url() {
1616
}
1717

1818
fetch_elixir_versions() {
19-
url="https://repo.hex.pm/builds/elixir/builds.txt"
19+
url="https://builds.hex.pm/builds/elixir/builds.txt"
2020
curl -s "$url" | awk '/^v[0-9.]+[- ]/ { print $1 }'
2121
}
2222

2323
fetch_erlang_versions() {
2424
case "${STACK}" in
2525
"heroku-20")
26-
url="https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
26+
url="https://builds.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
2727
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
2828
;;
2929
"heroku-22")
30-
url="https://repo.hex.pm/builds/otp/ubuntu-22.04/builds.txt"
30+
url="https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt"
3131
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
3232
;;
3333
*)

lib/elixir_funcs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ function download_elixir() {
77
elixir_changed=true
88
local otp_version=$(otp_version ${erlang_version})
99

10-
local download_url="https://repo.hex.pm/builds/elixir/${elixir_version}-otp-${otp_version}.zip"
10+
local download_url="https://builds.hex.pm/builds/elixir/${elixir_version}-otp-${otp_version}.zip"
1111

1212
output_section "Fetching Elixir ${elixir_version} for OTP ${otp_version} from ${download_url}"
1313

1414
curl -s ${download_url} -o $(elixir_cache_path)/$(elixir_download_file)
1515

1616
if [ $? -ne 0 ]; then
1717
output_section "Falling back to fetching Elixir ${elixir_version} for generic OTP version"
18-
local download_url="https://repo.hex.pm/builds/elixir/${elixir_version}.zip"
18+
local download_url="https://builds.hex.pm/builds/elixir/${elixir_version}.zip"
1919
curl -s ${download_url} -o $(elixir_cache_path)/$(elixir_download_file) || exit 1
2020
fi
2121
else

0 commit comments

Comments
 (0)