renovate/lib/modules/datasource/gitlab-releases
RahulGautamSingh d0b77e584a
feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122)
2024-05-21 07:04:12 +00:00
..
__snapshots__ test: use jest v29 (#17151) 2022-08-16 14:22:29 +02:00
index.spec.ts refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
index.ts feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
readme.md docs: use relative links (#26044) 2023-11-29 18:10:17 +00:00
types.ts refactor: lib/modules (#14488) 2022-03-04 09:04:02 +01:00

readme.md

GitLab Releases API supports looking up releases supported by GitLab and can be used in combination with regex managers to keep dependencies up-to-date which are not specifically supported by Renovate.

To specify which specific repository should be queried when looking up a package, the packageName should be set to the project path.

As an example, gitlab-org/ci-cd/package-stage/feature-testing/new-packages-list would look for releases in the gitlab-org/ci-cd/package-stage/feature-testing/new-packages-list project.

To specify where to find a self-hosted GitLab instance, specify registryUrl. An example would be https://gitlab.company.com.

Please note the following requirements:

  • This datasource requires at least GitLab 11.7

Usage Example

A real-world example for this specific datasource would be maintaining package versions in a config file. This can be achieved by configuring a custom manager in renovate.json for files named versions.ini:

{
  "customManagers": [
    {
      "customType": "regex",
      "fileMatch": ["^versions.ini$"],
      "matchStrings": [
        "# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?( registryUrl=(?<registryUrl>.*?))?\\s.*?_VERSION=(?<currentValue>.*)\\s"
      ],
      "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
    }
  ]
}

Now you may use comments in your versions.ini files to automatically update dependencies, which could look like this:

# renovate: datasource=gitlab-releases depName=gitlab-org/ci-cd/package-stage/feature-testing/new-packages-list versioning=semver registryUrl=https://gitlab.com
NKJS_VERSION=3.4.0

By default, gitlab-releases uses the semver-coerced versioning scheme.