From 3d6b342f847ea7b7544d36ed73a73b31ffc6dd37 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:08:57 +0000 Subject: [PATCH] Fail the build early on unsupported stacks In order to prevent the build completing apparently successfully, but the app fail to boot at runtime due to stack incompatibility. At first glance this would seem unnecessary due to the stack-specific URL meaning the `curl` would 404 on supported stacks. However #165 means the Cedar-14 binary is installed on all stacks, and on Heroku-20 causes the failures at runtime seen in #166. Future PRs will fix the curl/binary handling to use stack-specific URLs, however it's still nicer to explicitly handle unsupported stacks with a clear error message than a 404. --- CHANGELOG.md | 1 + bin/compile | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48effa5f..2a56ff97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +* [#177](https://github.com/heroku/heroku-buildpack-static/pull/177) Fail the build early on unsupported stacks ## v4 (2019-09-18) diff --git a/bin/compile b/bin/compile index 19d5c3ad..2cb54c94 100755 --- a/bin/compile +++ b/bin/compile @@ -8,6 +8,16 @@ cache_dir=$2 env_dir=$3 bp_dir=$(dirname $(dirname $0)) +case "${STACK}" in + cedar-14|heroku-16|heroku-18) + # Supported stack + ;; + *) + echo "Stack ${STACK} is not supported!" + exit 1 + ;; +esac + fetch_nginx_tarball() { local version="1.9.7" local tarball_file="nginx-$version.tgz"