forked from heroku/nodejs-yarn-buildpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] --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. | ||
|