-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deprecation warnings to legacy builder images
Adds deprecation warnings to the `heroku/builder-classic:22` and `heroku/buildpacks:20` CNB builder images, to raise awareness that they are no longer recommended. The warnings have been added using a warnings buildpack, similar to the approach used for the Heroku-18 EOL in: #336 For now these are just warnings, however, in the future will be changed to an error (skippable via env var, like in the PR linked above). Since these are warnings, the buildpack has been added to the end of the order group, such that the message is at the end of the overall build log, and so hopefully more visible to end users. Once the warning is turned into an error, the buildpack should be moved to the start of the order groups, so the build fails early for improved UX. A separate buildpack was used for each builder, since there is no other easy way to customise the message shown for each (and I wanted to include the name of the deprecated builder in the warning message, so users know what image name to grep for). These buildpacks were written in bash (rather than in Rust, using `libcnb.rs`), since: - the buildpack functionality we need is extremely simple - the buildpack is temporary (it will be deleted when we stop updating these builders in the future), so we don't need/want long term published images on CNB registry or to have to set up a Rust compilation/packaging step in this repo. The buildpacks give zero lint warnings when checked with shellcheck locally. GUS-W-14194729. GUS-W-14194736.
- Loading branch information
Showing
9 changed files
with
152 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
function echo_stderr() { | ||
local ansi_red="\033[1;31m" | ||
local ansi_reset="\033[0m" | ||
echo -e "\n${ansi_red}${1}${ansi_reset}\n" >&2 | ||
} | ||
|
||
read -r -d '' EOL_MESSAGE <<'EOF' || true | ||
####################################################################### | ||
WARNING: This builder image (heroku/builder-classic:22) is deprecated, | ||
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#heroku-cnb-builder-images | ||
If you are using the Pack CLI, you will need to adjust your '--builder' | ||
CLI argument, or else change the default builder configuration: | ||
https://buildpacks.io/docs/tools/pack/cli/pack_config_default-builder/ | ||
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. | ||
####################################################################### | ||
EOF | ||
|
||
echo_stderr "${EOL_MESSAGE}" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
api = "0.9" | ||
|
||
[buildpack] | ||
id = "heroku/builder-eol-warning" | ||
version = "1.0.0" | ||
|
||
[[stacks]] | ||
id = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
function echo_stderr() { | ||
local ansi_red="\033[1;31m" | ||
local ansi_reset="\033[0m" | ||
echo -e "\n${ansi_red}${1}${ansi_reset}\n" >&2 | ||
} | ||
|
||
read -r -d '' EOL_MESSAGE <<'EOF' || true | ||
####################################################################### | ||
WARNING: This builder image (heroku/buildpacks:20) is deprecated, | ||
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#heroku-cnb-builder-images | ||
If you are using the Pack CLI, you will need to adjust your '--builder' | ||
CLI argument, or else change the default builder configuration: | ||
https://buildpacks.io/docs/tools/pack/cli/pack_config_default-builder/ | ||
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. | ||
####################################################################### | ||
EOF | ||
|
||
echo_stderr "${EOL_MESSAGE}" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
api = "0.9" | ||
|
||
[buildpack] | ||
id = "heroku/builder-eol-warning" | ||
version = "1.0.0" | ||
|
||
[[stacks]] | ||
id = "*" |