On this page
Bazelmod
| source | condition | target |
|---|---|---|
✔ | ✔ | ✔ |
Description
The bazelmod resource reads and writes the version of one dependency in a MODULE.bazel file, the bazel_dep entries of Bzlmod:
bazel_dep(name = "rules_python", version = "0.27.0")
bazel_dep(name = "gazelle", version = "0.35.0")- source
Returns the version currently pinned for
module.- condition
Checks that the file pins the expected version.
- target
Updates that version. A file already holding it is left untouched.
It is the local half of the pair: bazelregistry finds the version available upstream, bazelmod writes it into your repository.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| file | string | File specifies the path to the MODULE.bazel file compatible:
example:
| |
| module | string | Module specifies the Bazel module name to target compatible:
example:
|
Both file and module are mandatory (missing either aborts the run with wrong spec content, preceded by bazelmod file undefined or bazelmod module undefined).
fileThe path to the
MODULE.bazelfile, e.g.MODULE.bazelorpath/to/MODULE.bazel. There is no default, and nofileslist (use one target per file).moduleThe module name as it appears in
bazel_dep(name = …), e.g.rules_go.
Example
sources:
latest:
name: Get the latest version of rules_python
kind: bazelregistry
spec:
module: rules_python
targets:
rules_python:
name: Bump Bazel module rules_python
kind: bazelmod
sourceid: latest
spec:
file: project2/MODULE.bazel
module: rules_pythonLinks
The bazel autodiscovery crawler - generates these manifests for you