Skip to content

Commit 7de21d0

Browse files
authored
Merge pull request #211 from kaikuchn/master
Add support for Heroku Stack-22.
2 parents 42e1f8d + dd4cbc4 commit 7de21d0

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Erlang - Prebuilt packages (17.5, 17.4, etc)
1717
* The full list of prebuilt packages can be found here:
1818
* 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
1920
* All other stacks: https://github.com/HashNuke/heroku-buildpack-elixir-otp-builds/blob/master/otp-versions
2021
* Elixir - Prebuilt releases (1.0.4, 1.0.3, etc) or prebuilt branches (master, v1.7, etc)
2122
* The full list of releases can be found here: https://github.com/elixir-lang/elixir/releases

lib/canonical_version.sh

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/usr/bin/env bash
22

33
erlang_builds_url() {
4-
if [ "$STACK" = "heroku-20" ]; then
5-
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-20.04"
6-
else
7-
erlang_builds_url="https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14"
8-
fi
4+
case "${STACK}" in
5+
"heroku-20")
6+
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-20.04"
7+
;;
8+
"heroku-22")
9+
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-22.04"
10+
;;
11+
*)
12+
erlang_builds_url="https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14"
13+
;;
14+
esac
915
echo $erlang_builds_url
1016
}
1117

@@ -15,13 +21,20 @@ fetch_elixir_versions() {
1521
}
1622

1723
fetch_erlang_versions() {
18-
if [ "$STACK" = "heroku-20" ]; then
19-
url="https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
20-
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
21-
else
22-
url="https://raw.githubusercontent.com/HashNuke/heroku-buildpack-elixir-otp-builds/master/otp-versions"
23-
curl -s "$url"
24-
fi
24+
case "${STACK}" in
25+
"heroku-20")
26+
url="https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
27+
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
28+
;;
29+
"heroku-22")
30+
url="https://repo.hex.pm/builds/otp/ubuntu-22.04/builds.txt"
31+
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
32+
;;
33+
*)
34+
url="https://raw.githubusercontent.com/HashNuke/heroku-buildpack-elixir-otp-builds/master/otp-versions"
35+
curl -s "$url"
36+
;;
37+
esac
2538
}
2639

2740
exact_erlang_version_available() {

0 commit comments

Comments
 (0)