Skip to content

Commit

Permalink
Switch from stacks to targets AKA "Stay on target"
Browse files Browse the repository at this point in the history
Buildpack API 0.10 removed the concept of stacks in favor of targets heroku/libcnb.rs#773. 

This commit works to upgrade applications in place by migrating metadata to support the new serialization format. This is supported by implementing TryMigrate from the `magic_migrate` crate https://docs.rs/magic_migrate/latest/magic_migrate/macro.try_migrate_link.html. 


https://www.youtube.com/watch?v=NnP5iDKwuwk
  • Loading branch information
schneems committed May 10, 2024
1 parent 38b0b81 commit f2f6e54
Show file tree
Hide file tree
Showing 9 changed files with 453 additions and 67 deletions.
50 changes: 30 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions buildpacks/ruby/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ glob = "0.3"
indoc = "2"
# libcnb has a much bigger impact on buildpack behaviour than any other dependencies,
# so it's pinned to an exact version to isolate it from lockfile refreshes.
libcnb = "=0.19.0"
libcnb = "=0.21.0"
libherokubuildpack = { version = "=0.21.0", default-features = false, features = ["digest"] }
rand = "0.8"
# TODO: Consolidate on either the regex crate or the fancy-regex crate, since this repo currently uses both.
Expand All @@ -27,7 +27,8 @@ tempfile = "3"
thiserror = "1"
ureq = { version = "2", default-features = false, features = ["tls"] }
url = "2"
magic_migrate = "0.1"
toml = "0.8"

[dev-dependencies]
libcnb-test = "=0.19.0"
toml = "0.8"
libcnb-test = "=0.21.0"
21 changes: 17 additions & 4 deletions buildpacks/ruby/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ keywords = ["ruby", "rails", "heroku"]
type = "BSD-3-Clause"

[[stacks]]
id = "heroku-20"

[[stacks]]
id = "heroku-22"
id = "*"

[metadata.release]
image = { repository = "docker.io/heroku/buildpack-ruby" }

[[targets]]
os = "linux"
arch = "arm64"

[[targets]]
os = "linux"
arch = "amd64"

[[targets.distros]]
name = "ubuntu"
version = "20.04"

[[targets.distros]]
name = "ubuntu"
version = "22.04"
Loading

0 comments on commit f2f6e54

Please sign in to comment.