renovate/lib/datasource
2020-02-27 23:43:13 +01:00
..
__snapshots__ chore(datasource): move test files to lib (#5426) 2020-02-11 05:08:10 +00:00
ansible-galaxy refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
cargo refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
cdnjs refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
dart refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
docker refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
git-submodules refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
git-tags refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
github-releases refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
github-tags refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
gitlab-tags refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
go refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
gradle-version refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
helm refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
hex refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
maven refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
npm refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
nuget refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
orb refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
packagist refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
pypi refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
ruby-version refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
rubygems refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
sbt refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
terraform refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
terraform-provider refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
common.ts refactor: narrow datasource config types 2020-02-27 23:43:13 +01:00
index.spec.ts feat: rename github/gitlab datasources (#5581) 2020-02-27 21:36:31 +01:00
index.ts chore: add datasource getters 2020-02-18 21:41:00 +01:00
metadata.spec.ts chore(datasource): move test files to lib (#5426) 2020-02-11 05:08:10 +00:00
metadata.ts chore: remove unnecessary depName variables in datasources 2020-02-27 22:04:10 +01:00
readme.md feat: rename github/gitlab datasources (#5581) 2020-02-27 21:36:31 +01:00

Datasources

Datasources are used in Renovate primarily to fetch released versions of packages.

getPkgReleases

The minimum exported interface for a datasource is a function called getPkgReleases that takes a lookup config as input.

The config contains:

  • lookupName: the package's full name including scope if present (e.g. @foo/bar)
  • registryUrls: an array of registry Urls to try

getPkgReleases should return an object containing:

  • releases: an array of strings of matched versions. This is the only mandatory field.
  • deprecationMessage: a string description of the package's deprecation notice, if applicable
  • sourceUrl: a HTTP URL pointing to the source code (e.g. on GitHub)
  • homepage: a HTTP URL for the package's homepage. Ideally should be empty if the homepage and sourceUrl are the same
  • changelogUrl: a URL pointing to the package's Changelog (could be a markdown file, for example). If not present then Renovate will search the sourceUrl for a changelog file.
  • tags: an object mapping tag -> version, e.g. tags: { latest: '3.0.0' }. This is only used by the followTags function.

getDigest

Datasources that support the concept of digests (e.g. docker digests and git commit hashes) also can export a getDigest function.

The getDigest function has two inputs:

  • config: the Renovate config for the package being updated, contains same fields as getPkgReleases
  • newValue: the version or value to retrieve the digest for

The getDigest function returns a string output representing the digest value. If none is found then a return value of null should be returned.