@@ -8,7 +8,8 @@ This manager is unique in Renovate in that:
...
@@ -8,7 +8,8 @@ This manager is unique in Renovate in that:
### Required Fields
### Required Fields
The first two required fields are `fileMatch` and `matchStrings`. `fileMatch` works the same as any manager, while `matchStrings` is a `regexManagers` concept and is used for configuring a regular expression with named capture groups.
The first two required fields are `fileMatch` and `matchStrings`.
`fileMatch` works the same as any manager, while `matchStrings` is a `regexManagers` concept and is used for configuring a regular expression with named capture groups.
In order for Renovate to look up a dependency and decide about updates, it then needs the following information about each dependency:
In order for Renovate to look up a dependency and decide about updates, it then needs the following information about each dependency:
...
@@ -49,7 +50,8 @@ You can use the Code Generator in the sidebar and copy the regex in the generate
...
@@ -49,7 +50,8 @@ You can use the Code Generator in the sidebar and copy the regex in the generate
### Configuration templates
### Configuration templates
In many cases, named capture groups alone won't be enough and you'll need to configure Renovate with additional information about how to look up a dependency. Continuing the above example with Yarn, here is the full config:
In many cases, named capture groups alone won't be enough and you'll need to configure Renovate with additional information about how to look up a dependency.
Continuing the above example with Yarn, here is the full config:
```json
```json
{
{
...
@@ -66,7 +68,8 @@ In many cases, named capture groups alone won't be enough and you'll need to con
...
@@ -66,7 +68,8 @@ In many cases, named capture groups alone won't be enough and you'll need to con
### Advanced Capture
### Advanced Capture
Let's say that your `Dockerfile` has many `ENV` variables you want to keep updated and you prefer not to write one `regexManagers` rule per variable. Instead you could enhance your `Dockerfile` like the following:
Let's say that your `Dockerfile` has many `ENV` variables you want to keep updated and you prefer not to write one `regexManagers` rule per variable.
Instead you could enhance your `Dockerfile` like the following:
@@ -104,6 +107,9 @@ The above (obviously not a complete `Dockerfile`, but abbreviated for this examp
...
@@ -104,6 +107,9 @@ The above (obviously not a complete `Dockerfile`, but abbreviated for this examp
}
}
```
```
In the above the `versioningTemplate` is not actually necessary because Renovate already defaults to `semver` versioning, but it has been included to help illustrate why we call these fields _templates_. They are named this way because they are compiled using Handlebars and so can be composed from values you collect in named capture groups. You will usually want to use the tripe brace `{{{ }}}` template (e.v. `{{{versioning}}}` to be safe because Handlebars escapes special characters by default with double braces.
In the above the `versioningTemplate` is not actually necessary because Renovate already defaults to `semver` versioning, but it has been included to help illustrate why we call these fields _templates_.
They are named this way because they are compiled using Handlebars and so can be composed from values you collect in named capture groups.
You will usually want to use the tripe brace `{{{ }}}` template (e.v. `{{{versioning}}}` to be safe because Handlebars escapes special characters by default with double braces.
By adding the comments to the `Dockerfile`, you can see that instead of four separate `regexManagers` being required, there is now only one - and the `Dockerfile` itself is now somewhat better documented too. The syntax we used there is completely arbitrary and you may choose your own instead if you prefer - just be sure to update your `matchStrings` regex.
By adding the comments to the `Dockerfile`, you can see that instead of four separate `regexManagers` being required, there is now only one - and the `Dockerfile` itself is now somewhat better documented too.
The syntax we used there is completely arbitrary and you may choose your own instead if you prefer - just be sure to update your `matchStrings` regex.