0

docs: Mention the CIPD GN template in cipd.md.

Change-Id: Ica186f98a2a620281447db4965ad2788e7dba85f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2181427
Reviewed-by: Erik Staab <estaab@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766916}
This commit is contained in:
Ben Pastene
2020-05-08 18:45:11 +00:00
committed by Commit Bot
parent 9d54fbc0bf
commit 9f3790fa7e

@ -62,7 +62,33 @@ lay them out like so:
### 3. Create a cipd.yaml file
CIPD knows how to create your package based on a .yaml file you provide to it.
The .yaml file should take the following form:
This file can either be generated by a GN template, or manually.
#### 3a. Generating cipd.yaml via GN Template:
The `cipd_package_definition` template in [build/cipd/cipd.gni] can be used to
create the yaml definition as part of Chromium's normal build process. Declare
a target like:
```
cipd_package_definition("my_cipd_package") {
package = "path/to/cipd/package"
description = "Prebuilt test binary."
install_mode = "copy"
deps = [ "//path/to:test_binary_target" ]
sources = [ "//path/to:test_binary_file" ]
}
```
After generating build files, you can then run
`ninja -C out/Default my_cipd_package`, which creates the .yaml file under
`out/Default/my_cipd_package/package.yaml`.
[build/cipd/cipd.gni]: https://source.chromium.org/chromium/chromium/src/+/master:build/cipd/cipd.gni
#### 3b. Generating cipd.yaml by hand:
You can also write the .yaml file by hand. The file should take the following
form:
```
# Comments are allowed.
@ -122,17 +148,13 @@ data:
- file: foo.jar
```
To create a private (Googler-only) package:
```
# Map this to //clank/third_party/sample_cipd_dep.
package: chrome_internal/third_party/sample_cipd_dep
```
For more information about the package definition spec, see [the code].
> **Note:** Committing the .yaml file to the repository isn't required,
> but it is recommended. Doing so has benefits for visibility and ease of
> future updates.
> **Note:** To make the package private (Googler-only), prefix the package name
> with `chrome_internal`. For example:
> ```
> package: chrome_internal/third_party/sample_cipd_dep
> ```
[the code]: https://chromium.googlesource.com/infra/luci/luci-go/+/master/cipd/client/cipd/builder/pkgdef.go