Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax committed Feb 6, 2024
1 parent 7dd0866 commit b34e98a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
It is an opinionated implementation adding language constructs and convenience methods for working
with the spec. It values strong adherence to the spec and data formats.

It currently targets version `0.9` of the CNB [Buildpack API specification](https://github.com/buildpacks/spec/blob/buildpack/0.9/buildpack.md).
It currently targets version `0.10` of the CNB [Buildpack API specification](https://github.com/buildpacks/spec/blob/buildpack/0.9/buildpack.md).

## Quick Start Guide

Expand Down Expand Up @@ -78,15 +78,16 @@ Since we're writing a Cloud Native Buildpack, we also need a `buildpack.toml`. U
file named `buildpack.toml` in the root of your project, right next to `Cargo.toml`.

```toml
api = "0.9"
api = "0.10"

[buildpack]
id = "libcnb-examples/my-buildpack"
version = "0.1.0"
name = "My Buildpack"

[[stacks]]
id = "*"
[[targets]]
os = "linux"
arch = "amd64"
```

That's all we need! We can now move on to finally write some buildpack code!
Expand Down Expand Up @@ -132,7 +133,7 @@ impl Buildpack for HelloWorldBuildpack {
type Error = GenericError;
// This method will be called when the CNB lifecycle executes the detect phase (`bin/detect`).
// Use the `DetectContext` to access CNB data such as the stack this buildpack is currently
// Use the `DetectContext` to access CNB data such as the operating system this buildpack is currently
// executed on, the app directory and similar things. When using libcnb.rs, you never have
// to read environment variables or read/write files to disk to interact with the CNB lifecycle.
//
Expand All @@ -148,6 +149,7 @@ impl Buildpack for HelloWorldBuildpack {
// build phase (`bin/build`).
fn build(&self, context: BuildContext<Self>) -> libcnb::Result<BuildResult, Self::Error> {
println!("Hello World!");
println!("Build runs on: {} ({})!", context.target_os, context.target_arch);
BuildResultBuilder::new()
.launch(
Expand Down Expand Up @@ -217,7 +219,7 @@ libcnb-examples/my-buildpack 0.1.0
===> RESTORING
===> BUILDING
Hello World!
Build runs on stack heroku-22!
Build runs on: linux (amd64)!
===> EXPORTING
Adding layer 'buildpacksio/lifecycle:launch.sbom'
Adding 1/1 app layer(s)
Expand All @@ -229,7 +231,7 @@ Adding label 'io.buildpacks.build.metadata'
Adding label 'io.buildpacks.project.metadata'
Setting default process type 'web'
Saving my-image...
*** Images (aa4695184718):
*** Images (85b067fc926a):
my-image
Successfully built image my-image
```
Expand Down

0 comments on commit b34e98a

Please sign in to comment.