-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild
executable file
·59 lines (45 loc) · 1.77 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
set -euo pipefail
ENV_DIR="${2}/env"
ENV_VAR_NAME='ALLOW_EOL_SHIMMED_BUILDER'
ALLOW_BUILD="$(cat "${ENV_DIR}/${ENV_VAR_NAME}" 2> /dev/null || true)"
ANSI_RED="\033[1;31m"
ANSI_RESET="\033[0m"
function display_error() {
echo >&2
# We have to ANSI wrap each line separately to prevent breakage if line prefixes are added
# later (such as when the builder is untrusted, or when Git adds the "remote:" prefix).
while IFS= read -r line; do
echo -e "${ANSI_RED}${line}${ANSI_RESET}" >&2
done <<< "${1}"
echo >&2
}
if [[ "${ALLOW_BUILD}" == "1" ]]; then
MSG_PREFIX="WARNING"
MSG_FOOTER="Allowing the build to continue since ${ENV_VAR_NAME} is set."
EXIT_CODE=0
else
MSG_PREFIX="ERROR"
MSG_FOOTER="To ignore this error, set the env var ${ENV_VAR_NAME} to 1."
EXIT_CODE=1
fi
display_error "$(cat <<EOF
#######################################################################
${MSG_PREFIX}: This builder image (heroku/buildpacks:20) has been sunset,
since it uses legacy shimmed classic Heroku buildpacks, rather than
Heroku's next-generation Cloud Native Buildpacks.
As such, this image is no longer supported and will soon stop receiving
security updates.
Please switch to one of our newer 'heroku/builder:*' builder images,
such as 'heroku/builder:22':
https://github.com/heroku/cnb-builder-images#available-images
If you are using the Pack CLI, you will need to adjust your '--builder'
CLI argument, or else change the default builder configuration using:
'pack config default-builder <new_builder_name>'
If you are using a third-party platform to deploy your app, check their
documentation for how to adjust the builder image used for your build.
${MSG_FOOTER}
#######################################################################
EOF
)"
exit ${EXIT_CODE}