-
HonkingGoose authoredHonkingGoose authored
title: Self-Hosted configuration
description: Self-Hosted configuration usable in config file, CLI or environment variables
Self-Hosted configuration options
You can only use these configuration options when you're self-hosting Renovate.
Please also see Self-Hosted Experimental Options.
!!! note
Config options with type=string
are always non-mergeable, so mergeable=false
.
allowCustomCrateRegistries
allowPlugins
allowPostUpgradeCommandTemplating
Let's look at an example of configuring packages with existing Angular migrations.
module.exports = {
allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'],
};
In the renovate.json
file, define the commands and files to be included in the final commit.
The command to install dependencies (npm ci --ignore-scripts
) is needed because, by default, the installation of dependencies is skipped (see the skipInstalls
global option).
{
"packageRules": [
{
"matchPackageNames": ["@angular/core"],
"postUpgradeTasks": {
"commands": [
"npm ci --ignore-scripts",
"npx ng update {{{depName}}} --from={{{currentVersion}}} --to={{{newVersion}}} --migrate-only --allow-dirty --force"
]
}
}
]
}
With this configuration, the executable command for @angular/core
looks like this:
npm ci --ignore-scripts
npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dirty --force
If you wish to disable templating because of any security or performance concern, you may set allowPostUpgradeCommandTemplating
to false
.
But before you disable templating completely, try the allowedPostUpgradeCommands
config option to limit what commands are allowed to run.
allowScripts
allowedPostUpgradeCommands
A list of regular expressions that decide which commands in postUpgradeTasks
are allowed to run.
If this list is empty then no tasks will be executed.
For example:
{
"allowedPostUpgradeCommands": ["^tslint --fix$", "^tslint --[a-z]+$"]
}
autodiscover
When you enable autodiscover
, by default, Renovate runs on every repository that the bot account can access.
You can limit which repositories Renovate can access by using the autodiscoverFilter
config option.
autodiscoverFilter
You can use this option to filter the list of repositories that the Renovate bot account can access through autodiscover
.
It takes a minimatch glob-style or regex pattern.
If you set multiple filters, then the matches of each filter are added to the overall result.
If you use an environment variable or the CLI to set the value for autodiscoverFilter
, then commas ,
within filters are not supported.
Commas will be used as delimiter for a new filter.
# DO NOT use commas inside the filter if your are using env or CLI variables to configure it.
RENOVATE_AUTODISCOVER_FILTER="/myapp/{readme.md,src/**}"
# in this example you can use regex instead
RENOVATE_AUTODISCOVER_FILTER="/myapp/(readme\.md|src/.*)/"
Minimatch:
{
"autodiscoverFilter": ["project/*"]
}
The search for repositories is case-insensitive.
Regex:
All text inside the start and end /
will be treated as a regular expression.
{
"autodiscoverFilter": ["/project/.*/"]
}
You can negate the regex by putting an !
in front.
Only use a single negation and don't mix with other filters because all filters are combined with or
.
If using negations, all repositories except those who match the regex are added to the result:
{
"autodiscoverFilter": ["!/project/.*/"]
}
autodiscoverNamespaces
You can use this option to autodiscover projects in specific namespaces (a.k.a. groups/organizations/workspaces).
In contrast to autodiscoverFilter
the filtering is done by the platform and therefore more efficient.
For example:
{
"platform": "gitlab",
"autodiscoverNamespaces": ["a-group", "another-group/some-subgroup"]
}
autodiscoverTopics
Some platforms allow you to add tags, or topics, to repositories and retrieve repository lists by specifying those topics. Set this variable to a list of strings, all of which will be topics for the autodiscovered repositories.
For example:
{
"autodiscoverTopics": ["managed-by-renovate"]
}
baseDir
By default Renovate uses a temporary directory like /tmp/renovate
to store its data.
You can override this default with the baseDir
option.
For example:
{
"baseDir": "/my-own-different-temporary-folder"
}
bbUseDevelopmentBranch
By default, Renovate will use a repository's "main branch" (typically called main
or master
) as the "default branch".