From ba7dd3c32105eb47c707909cab48794a6765fa11 Mon Sep 17 00:00:00 2001 From: Paulo Fagiani Date: Tue, 5 Jul 2022 19:06:00 -0300 Subject: [PATCH] Update usage on README --- README.md | 66 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 788e307..eb135f8 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,10 @@ This buildpack builds on top of the existing [Node.js Engine Cloud Native Buildp ## Usage -This buildpack is not meant to be used on its own, and instead should be in used in combination with other buildpacks. - -Include a list of `apt` package names to be installed in a file named `Aptfile`; be aware that line ending should be LF, not CRLF. - -The buildpack automatically downloads and installs the packages when you run a build: +This buildpack is meant to be used with `heroku/nodejs-engine` version `0.7.3`. ``` -$ pack build --buildpack fagiani/nodejs-yarn myapp +$ pack build --buildpack heroku/nodejs-engine@0.7.3 --buildpack fagiani/nodejs-yarn myapp ``` ### Define a custom path for yarn (optional) @@ -29,64 +25,6 @@ You can optionally create a `yarn.lock` file in the root directory with a line l Make sure you place the actual `package.json` and `yarn.lock` in that path -### Build the image - -#### with buildpacks - -Using pack, you're ready to create an image from the buildpack and source code. You will need to add flags that point to the path of the source code (`--path`) and the paths of the buildpacks (`--buildpack`). - -```sh -cd nodejs-yarn-buildpack -pack build TEST_IMAGE_NAME --path ../TEST_REPO_PATH --buildpack ../nodejs-engine-buildpack --buildpack ../nodejs-yarn-buildpack -``` - -#### with a builder - -You can also create a `builder.toml` file that will have explicit directions when creating a buildpack. This is useful when there are multiple "detect" paths a build can take (ie. yarn vs. npm commands). - -In a directory outside of this buildpack, create a builder file: - -```sh -cd .. -mkdir heroku_nodejs_builder -touch heroku_nodejs_builder/builder.toml -``` - -For local development, you'll want the file to look like this: - -```toml -[[buildpacks]] - id = "heroku/nodejs-engine-buildpack" - uri = "../nodejs-engine-buildpack" - -[[buildpacks]] - id = "heroku/nodejs-yarn-buildpack" - uri = "../nodejs-yarn-buildpack" - -[[order]] - group = [ - { id = "heroku/nodejs-engine-buildpack", version = "0.0.1" }, - { id = "heroku/nodejs-yarn-buildpack", version = "0.0.1" } - ] - -[stack] - id = "heroku-18" - build-image = "heroku/pack:18" - run-image = "heroku/pack:18" -``` - -Create the builder with `pack`: - -```sh -pack create-builder nodejs --builder-config ../heroku-nodejs-builder/builder.toml -``` - -Now you can use the builder image instead of chaining the buildpacks. - -```sh -pack build TEST_IMAGE_NAME --path ../TEST_REPO_PATH --builder nodejs -``` - ## Contributing 1. Open a pull request.