Skip to content

Commit

Permalink
Add support for Heroku Stack-22.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikuchn committed Aug 11, 2022
1 parent 42e1f8d commit dd4cbc4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Erlang - Prebuilt packages (17.5, 17.4, etc)
* The full list of prebuilt packages can be found here:
* gigalixir-20 or heroku-20 stacks: https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt
* heroku-22 stacks: https://repo.hex.pm/builds/otp/ubuntu-22.04/builds.txt
* All other stacks: https://github.com/HashNuke/heroku-buildpack-elixir-otp-builds/blob/master/otp-versions
* Elixir - Prebuilt releases (1.0.4, 1.0.3, etc) or prebuilt branches (master, v1.7, etc)
* The full list of releases can be found here: https://github.com/elixir-lang/elixir/releases
Expand Down
37 changes: 25 additions & 12 deletions lib/canonical_version.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/usr/bin/env bash

erlang_builds_url() {
if [ "$STACK" = "heroku-20" ]; then
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-20.04"
else
erlang_builds_url="https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14"
fi
case "${STACK}" in
"heroku-20")
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-20.04"
;;
"heroku-22")
erlang_builds_url="https://repo.hex.pm/builds/otp/ubuntu-22.04"
;;
*)
erlang_builds_url="https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14"
;;
esac
echo $erlang_builds_url
}

Expand All @@ -15,13 +21,20 @@ fetch_elixir_versions() {
}

fetch_erlang_versions() {
if [ "$STACK" = "heroku-20" ]; then
url="https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
else
url="https://raw.githubusercontent.com/HashNuke/heroku-buildpack-elixir-otp-builds/master/otp-versions"
curl -s "$url"
fi
case "${STACK}" in
"heroku-20")
url="https://repo.hex.pm/builds/otp/ubuntu-20.04/builds.txt"
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
;;
"heroku-22")
url="https://repo.hex.pm/builds/otp/ubuntu-22.04/builds.txt"
curl -s "$url" | awk '/^OTP-([0-9.]+ )/ {print substr($1,5)}'
;;
*)
url="https://raw.githubusercontent.com/HashNuke/heroku-buildpack-elixir-otp-builds/master/otp-versions"
curl -s "$url"
;;
esac
}

exact_erlang_version_available() {
Expand Down

0 comments on commit dd4cbc4

Please sign in to comment.