Skip to content

Commit

Permalink
docs: improve documentation for GitLab datasources (#19393)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
  • Loading branch information
darkdragon-001 and HonkingGoose committed Dec 15, 2022
1 parent 53e8844 commit 828df23
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/modules/datasource/gitlab-packages/readme.md
Expand Up @@ -4,6 +4,9 @@ To specify which specific repository should be queried when looking up a package

As an example, `gitlab-org/ci-cd/package-stage/feature-testing/new-packages-list:@gitlab-org/nk-js` would look for the`@gitlab-org/nk-js` packages in the generic packages repository of 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`.

If you are using a self-hosted GitLab instance, please note the following requirements:

- If you are on the `Free` edition, this datasource requires at least GitLab 13.3
Expand Down
40 changes: 40 additions & 0 deletions lib/modules/datasource/gitlab-releases/readme.md
@@ -0,0 +1,40 @@
[GitLab Releases API](https://docs.gitlab.com/ee/api/releases/) supports looking up [releases supported by GitLab](https://docs.gitlab.com/ee/user/project/releases/) and can be used in combination with [regex managers](https://docs.renovatebot.com/modules/manager/regex/) 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 `depName` 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 generic regex manager in `renovate.json` for files named `versions.ini`:

```json
{
"regexManagers": [
{
"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:

```ini
# 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` versioning scheme.
35 changes: 35 additions & 0 deletions lib/modules/datasource/gitlab-tags/readme.md
@@ -0,0 +1,35 @@
[GitLab Tags API](https://docs.gitlab.com/ee/api/tags.html) supports looking up [Git tags](https://docs.gitlab.com/ee/topics/git/tags.html#tags) and can be used in combination with [regex managers](https://docs.renovatebot.com/modules/manager/regex/) 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 `depName` 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`.

**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 generic regex manager in `renovate.json` for files named `versions.ini`:

```json
{
"regexManagers": [
{
"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:

```ini
# renovate: datasource=gitlab-tags 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-tags` uses the `semver` versioning scheme.

0 comments on commit 828df23

Please sign in to comment.