2017-01-15 17:59:32 +00:00
# Configuration
## Configuration Methods
Configuration is supported via any or all of the below:
- Configuration file
- Environment
- CLI
2017-01-18 18:55:03 +00:00
- `renovate.json` in target repository
- `renovate` field of `package.json` in target repository
2017-01-15 17:59:32 +00:00
The above are listed in reverse order of preference.
2017-01-18 18:55:03 +00:00
i.e. `package.json` settings will override `renovate.json` settings, CLI, which overrides env, which overrides the config file, which overrides defaults.
2017-01-15 17:59:32 +00:00
### Default Configuration
2017-03-13 06:04:36 +00:00
Default configuration can be found in [lib/config/definitions.js ](../lib/config/definitions.js )
2017-01-15 17:59:32 +00:00
### Configuration File
You can override default configuration using a configuration file, with default name `config.js` in the working directory. If you need an alternate location or name, set it in the environment variable `RENOVATE_CONFIG_FILE` .
Using a configuration file gives you very granular configuration options. For instance, you can override most settings at the global (file), repository, or package level. e.g. apply one set of labels for `backend/package.json` and a different set for `frontend/package.json` in the same repository.
```javascript
module.exports = {
2017-01-19 09:27:31 +00:00
labels: ['upgrade'],
2017-01-15 17:59:32 +00:00
depTypes: ['dependencies', 'devDependencies'],
repositories: [
{
repository: 'singapore/repo1',
packageFiles: [
'package.json',
{
fileName: 'frontend/package.json',
2017-01-19 09:27:31 +00:00
labels: ['upgrade', 'frontend']
2017-01-15 17:59:32 +00:00
},
],
},
{
repository: 'singapore/repo2',
2017-04-15 09:37:35 +00:00
depTypes: [
'dependencies',
'devDependencies',
{
depType: 'optionalDependencies',
labels: ['renovate', 'optional'],
},
],
2017-01-15 17:59:32 +00:00
labels: ['renovate'],
},
'singapore/repo3',
2017-04-15 09:37:35 +00:00
],
packages: [
{
package: 'jquery',
labels: ['jquery', 'uhoh'],
},
],
2017-01-15 17:59:32 +00:00
}
```
### CLI
```
2017-01-17 13:27:48 +00:00
$ node renovate --help
Usage: renovate [options] [repositories...]
Options:
2017-04-15 10:44:50 +00:00
-h, --help output usage information
--enabled [boolean] Enable or disable renovate
--onboarding [boolean] Require a Configuration PR first
--platform < string > Platform type of repository
--endpoint < string > Custom endpoint to use
--token < string > Repository Auth Token
2017-04-21 05:00:26 +00:00
--autodiscover [boolean] Autodiscover all repositories
2017-04-15 10:44:50 +00:00
--package-files < list > Package file paths
--dep-types < list > Dependency types
--separate-major-releases [boolean] If set to false, it will upgrade dependencies to latest release only, and not separate major/minor branches
--ignore-deps < list > Dependencies to ignore
--ignore-future [boolean] Ignore versions tagged as "future"
--ignore-unstable [boolean] Ignore versions with unstable semver
--respect-latest [boolean] Ignore versions newer than npm "latest" version
--recreate-closed [boolean] Recreate PRs even if same ones were closed previously
--rebase-stale-prs [boolean] Rebase stale PRs (GitHub only)
2017-04-20 05:11:45 +00:00
--pr-creation < string > When to create the PR for a branch. Values: immediate, not-pending, status-success.
2017-04-20 11:01:23 +00:00
--automerge < string > What types of upgrades to merge to base branch automatically. Values: none, minor or any
2017-04-17 02:54:42 +00:00
--maintain-yarn-lock [boolean] Keep yarn.lock files updated in base branch
2017-04-15 20:04:14 +00:00
--group-name < string > Human understandable name for the dependency group
--group-slug < string > Slug to use for group (e.g. in branch name). Will be calculated from groupName if null
2017-04-15 10:44:50 +00:00
--labels < list > Labels to add to Pull Request
--assignees < list > Assignees for Pull Request
--reviewers < list > Requested reviewers for Pull Requests (GitHub only)
--pin-versions [boolean] Convert ranged versions in package.json to pinned versions
--log-level < string > Logging level
2017-01-17 13:27:48 +00:00
Examples:
$ renovate --token abc123 singapore/lint-condo
2017-01-20 13:03:18 +00:00
$ renovate --ignore-unstable=false --log-level verbose singapore/lint-condo
2017-01-17 13:27:48 +00:00
$ renovate singapore/lint-condo singapore/package-test
2017-01-15 17:59:32 +00:00
```
2017-01-18 18:55:03 +00:00
### renovate.json
If you add a `renovate.json` file to the root of your repository, you can use this to override default settings.
If you leave the `packageFiles` field empty then `renovate` will still auto-discover all `package.json` files in the repository.
2017-01-15 17:59:32 +00:00
### package.json
If you add configuration options to your `package.json` then these will override any other settings above.
Obviously, you can't set repository or package file location with this method.
```json
"renovate": {
"labels": [
"upgrade",
"bot"
]
}
```
## Configuration Options
2017-01-20 13:03:18 +00:00
| Name | Description | Type | Default value | Environment | CLI |
|------|-------------|------|---------------|-------------|-----|
| `enabled` | Enable or disable renovate | boolean | `true` | `RENOVATE_ENABLED` | `--enabled` |
2017-01-30 06:37:43 +00:00
| `onboarding` | Require a Configuration PR first | boolean | `true` | `RENOVATE_ONBOARDING` | `--onboarding` |
2017-01-31 17:16:33 +00:00
| `platform` | Platform type of repository | string | `"github"` | `RENOVATE_PLATFORM` | `--platform` |
2017-02-05 08:10:29 +00:00
| `endpoint` | Custom endpoint to use | string | `null` | `RENOVATE_ENDPOINT` | `--endpoint` |
2017-01-31 17:16:33 +00:00
| `token` | Repository Auth Token | string | `null` | `RENOVATE_TOKEN` | `--token` |
2017-04-21 05:00:26 +00:00
| `autodiscover` | Autodiscover all repositories | boolean | `false` | `RENOVATE_AUTODISCOVER` | `--autodiscover` |
2017-03-13 09:07:57 +00:00
| `repositories` | List of Repositories | list | `[]` | `RENOVATE_REPOSITORIES` | |
2017-01-20 13:03:18 +00:00
| `packageFiles` | Package file paths | list | `[]` | `RENOVATE_PACKAGE_FILES` | `--package-files` |
| `depTypes` | Dependency types | list | `["dependencies", "devDependencies", "optionalDependencies"]` | `RENOVATE_DEP_TYPES` | `--dep-types` |
2017-04-15 10:44:50 +00:00
| `separateMajorReleases` | If set to false, it will upgrade dependencies to latest release only, and not separate major/minor branches | boolean | `true` | `RENOVATE_SEPARATE_MAJOR_RELEASES` | `--separate-major-releases` |
2017-01-20 13:03:18 +00:00
| `ignoreDeps` | Dependencies to ignore | list | `[]` | `RENOVATE_IGNORE_DEPS` | `--ignore-deps` |
| `ignoreFuture` | Ignore versions tagged as "future" | boolean | `true` | `RENOVATE_IGNORE_FUTURE` | `--ignore-future` |
| `ignoreUnstable` | Ignore versions with unstable semver | boolean | `true` | `RENOVATE_IGNORE_UNSTABLE` | `--ignore-unstable` |
| `respectLatest` | Ignore versions newer than npm "latest" version | boolean | `true` | `RENOVATE_RESPECT_LATEST` | `--respect-latest` |
| `recreateClosed` | Recreate PRs even if same ones were closed previously | boolean | `false` | `RENOVATE_RECREATE_CLOSED` | `--recreate-closed` |
2017-03-13 09:07:57 +00:00
| `rebaseStalePrs` | Rebase stale PRs (GitHub only) | boolean | `false` | `RENOVATE_REBASE_STALE_PRS` | `--rebase-stale-prs` |
2017-04-20 05:11:45 +00:00
| `prCreation` | When to create the PR for a branch. Values: immediate, not-pending, status-success. | string | `"immediate"` | `RENOVATE_PR_CREATION` | `--pr-creation` |
2017-04-20 11:01:23 +00:00
| `automerge` | What types of upgrades to merge to base branch automatically. Values: none, minor or any | string | `"none"` | `RENOVATE_AUTOMERGE` | `--automerge` |
2017-01-20 13:03:18 +00:00
| `branchName` | Branch name template | string | `"renovate/{{depName}}-{{newVersionMajor}}.x"` | | |
| `commitMessage` | Commit message template | string | `"Update dependency {{depName}} to version {{newVersion}}"` | | |
2017-04-13 19:25:00 +00:00
| `prTitle` | Pull Request title template | string | `"{{#if isPin}}Pin{{else}}Update{{/if}} dependency {{depName}} to version {{#if isRange}}{{newVersion}}{{else}}{{#if isMajor}}{{newVersionMajor}}.x{{else}}{{newVersion}}{{/if}}{{/if}}"` | | |
2017-02-11 07:15:47 +00:00
| `prBody` | Pull Request body template | string | `"This Pull Request updates dependency {{depName}} from version ` {{currentVersion}}` to `{{newVersion}}` \n\n{{changelog}}"` | | |
2017-04-17 02:54:42 +00:00
| `maintainYarnLock` | Keep yarn.lock files updated in base branch | boolean | `false` | `RENOVATE_MAINTAIN_YARN_LOCK` | `--maintain-yarn-lock` |
2017-04-13 20:39:46 +00:00
| `yarnMaintenanceBranchName` | Branch name template when maintaining yarn.lock | string | `"renovate/yarn-lock"` | | |
| `yarnMaintenanceCommitMessage` | Commit message template when maintaining yarn.lock | string | `"Renovate yarn.lock file"` | | |
| `yarnMaintenancePrTitle` | Pull Request title template when maintaining yarn.lock | string | `"Renovate yarn.lock file"` | | |
| `yarnMaintenancePrBody` | Pull Request body template when maintaining yarn.lock | string | `"This PR regenerates yarn.lock files based on the existing ` package.json` files."` | | |
2017-04-15 20:04:14 +00:00
| `groupName` | Human understandable name for the dependency group | string | `null` | `RENOVATE_GROUP_NAME` | `--group-name` |
| `groupSlug` | Slug to use for group (e.g. in branch name). Will be calculated from groupName if null | string | `null` | `RENOVATE_GROUP_SLUG` | `--group-slug` |
| `groupBranchName` | Branch name template for the group | string | `"renovate/{{groupSlug}}"` | | |
| `groupCommitMessage` | Group commit message | string | `"Renovate {{groupName}} packages"` | | |
| `groupPrTitle` | Pull Request title template for the group | string | `"Renovate {{groupName}} packages"` | | |
| `groupPrBody` | Pull Request body template for the group | string | `"This PR renovates the package group \"{{groupName}}\"."` | | |
2017-01-20 13:03:18 +00:00
| `labels` | Labels to add to Pull Request | list | `[]` | `RENOVATE_LABELS` | `--labels` |
| `assignees` | Assignees for Pull Request | list | `[]` | `RENOVATE_ASSIGNEES` | `--assignees` |
2017-03-13 09:07:57 +00:00
| `reviewers` | Requested reviewers for Pull Requests (GitHub only) | list | `[]` | `RENOVATE_REVIEWERS` | `--reviewers` |
2017-04-13 19:25:00 +00:00
| `pinVersions` | Convert ranged versions in package.json to pinned versions | boolean | `true` | `RENOVATE_PIN_VERSIONS` | `--pin-versions` |
2017-01-20 13:03:18 +00:00
| `logLevel` | Logging level | string | `"info"` | `LOG_LEVEL` | `--log-level` |