Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schneems/refactor bundle install layer #331

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 78 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions buildpacks/ruby/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ureq = { version = "2", default-features = false, features = ["tls"] }
url = "2"
magic_migrate = "0.2"
toml = "0.8"
bon = "2.3.0"

[dev-dependencies]
libcnb-test = "=0.23.0"
8 changes: 6 additions & 2 deletions buildpacks/ruby/src/layers/bundle_download_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Installs a copy of `bundler` to the `<layer-dir>` with a bundler executable in
//! `<layer-dir>/bin`. Must run before [`crate.steps.bundle_install`].
use crate::layers::shared::{cached_layer_write_metadata, MetadataDiff};
use crate::layers::shared::{cached_layer_builder, MetadataDiff};
use crate::RubyBuildpack;
use crate::RubyBuildpackError;
use bullet_stream::state::SubBullet;
Expand All @@ -28,7 +28,11 @@ pub(crate) fn handle(
mut bullet: Print<SubBullet<Stdout>>,
metadata: &Metadata,
) -> libcnb::Result<(Print<SubBullet<Stdout>>, LayerEnv), RubyBuildpackError> {
let layer_ref = cached_layer_write_metadata(layer_name!("bundler"), context, metadata)?;
let layer_ref = cached_layer_builder()
.layer_name(layer_name!("bundler"))
.context(context)
.metadata(metadata)
.call()?;
match &layer_ref.state {
LayerState::Restored { cause } => {
bullet = bullet.sub_bullet(cause);
Expand Down
Loading
Loading