Skip to content

Commit a2ec65b

Browse files
committed
prefetching-dependencies: Add yarn (JavaScript) to supported package managers
Signed-off-by: Michal Šoltis <[email protected]>
1 parent d486e87 commit a2ec65b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/modules/ROOT/pages/how-tos/configuring/prefetching-dependencies.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ For every build, Cachi2 generates a software bill of materials (SBOM) where all
2121
|xref:npm[npm]
2222
|`JavaScript`
2323

24+
|xref:yarn[yarn]
25+
|`JavaScript`
26+
2427
|xref:bundler[bundler]
2528
|`Ruby`
2629

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

307+
== [[yarn]]Enabling prefetch builds for `yarn`
308+
309+
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.
310+
311+
.Prerequisites
312+
313+
* 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.
314+
315+
.Procedure
316+
317+
To prefetch dependencies for a component build, complete the following steps:
318+
319+
. Go to the `.tekton` directory and find the `.yaml` files related to the `*pull request*` and `*push*` processes.
320+
. Configure the hermetic pipeline by adding the following parameters in both `.yaml` files:
321+
322+
+
323+
[source,yaml]
324+
----
325+
spec:
326+
params:
327+
- ...
328+
- name: prefetch-input
329+
value: '{"type": "yarn", "path": "."}'
330+
----
331+
304332
== [[bundler]]Enabling prefetch builds for `bundler`
305333

306334
.Prerequisites

0 commit comments

Comments
 (0)