Skip to content

Commit

Permalink
prefetching-dependencies: Add yarn (JavaScript) to supported package …
Browse files Browse the repository at this point in the history
…managers

Signed-off-by: Michal Šoltis <[email protected]>
  • Loading branch information
slimreaper35 committed Dec 17, 2024
1 parent d486e87 commit a2ec65b
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ For every build, Cachi2 generates a software bill of materials (SBOM) where all
|xref:npm[npm]
|`JavaScript`

|xref:yarn[yarn]
|`JavaScript`

|xref:bundler[bundler]
|`Ruby`

Expand Down Expand Up @@ -301,6 +304,31 @@ spec:
* From the {ProductName} *Applications* view, go to *Activity > Latest commits*.
//include::../partials/con_hermetic_verification.adoc[]

== [[yarn]]Enabling prefetch builds for `yarn`

Supported versions: 1.x and 3.x. Cachi2 automatically detects the version of `yarn` and fetches any dependencies you declare in your `package.json` and `yarn.lock` project files.

.Prerequisites

* You have an up-to-date `yarn.lock` file in your source repository. To make sure that you have the latest `yarn.lock` file, or to create a lockfile, run the `yarn install` command. If `yarn.lock` is not up-to-date, Cachi2 will not fetch the dependencies.

.Procedure

To prefetch dependencies for a component build, complete the following steps:

. Go to the `.tekton` directory and find the `.yaml` files related to the `*pull request*` and `*push*` processes.
. Configure the hermetic pipeline by adding the following parameters in both `.yaml` files:

+
[source,yaml]
----
spec:
params:
- ...
- name: prefetch-input
value: '{"type": "yarn", "path": "."}'
----

== [[bundler]]Enabling prefetch builds for `bundler`

.Prerequisites
Expand Down

0 comments on commit a2ec65b

Please sign in to comment.