Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(datasource/deb): document steps for Artifactory #31110

Merged
merged 12 commits into from
Sep 17, 2024
56 changes: 53 additions & 3 deletions lib/modules/datasource/deb/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
The Debian datasource enables Renovate to update packages from Debian repositories. It is ideal for projects that depend on Debian-based systems or distributions. You will need to combine Debian datasource with [regex managers](../../manager/regex/index.md) to update dependencies.
The Debian datasource enables Renovate to update packages from Debian repositories.
secustor marked this conversation as resolved.
Show resolved Hide resolved
It is ideal for projects that depend on Debian-based systems or distributions.
secustor marked this conversation as resolved.
Show resolved Hide resolved
You will need to combine Debian datasource with [regex managers](../../manager/regex/index.md) to update dependencies.
secustor marked this conversation as resolved.
Show resolved Hide resolved
secustor marked this conversation as resolved.
Show resolved Hide resolved

**Registry URL**
secustor marked this conversation as resolved.
Show resolved Hide resolved
To use a Debian repository with the datasource, you need a properly formatted URL with specific query parameters:
To use a Debian repository with the datasource, you need a properly formatted URL with specific query parameters as `registryUrl`:
secustor marked this conversation as resolved.
Show resolved Hide resolved

- `components`: Comma-separated list of repository components (e.g., `main,contrib,non-free`).
- `binaryArch`: Architecture of the binary packages (e.g., `amd64`,`all`).
Expand All @@ -17,7 +19,7 @@ https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&bina

This URL points to the `stable` suite of the Debian repository for `amd64` architecture, including `main`, `contrib`, and `non-free` components.

**Usage Example**
## Usage Example

Say you're using apt packages in a Dockerfile and want to update them.
With the debian datasource you can "pin" each dependency, and get automatic updates.
Expand All @@ -34,6 +36,7 @@ First you would set a custom manager in your `renovate.json` file for `Dockerfil
"matchStrings": [
"#\\s*renovate:\\s*?depName=(?<depName>.*?)?\\sENV .*?_VERSION=\"(?<currentValue>.*)\"\\s"
],
"registryUrlTemplate": "https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64",
secustor marked this conversation as resolved.
Show resolved Hide resolved
"datasourceTemplate": "deb"
}
]
Expand All @@ -55,3 +58,50 @@ RUN apt-get update && \
```

When the apt package for `gcc` is updated, Renovate updates the environment variable.

```json title="Overwrite deb registryUrl via packageRule"
secustor marked this conversation as resolved.
Show resolved Hide resolved
{
"packageRules": [
{
"matchDatasources": ["deb"],
"matchPackageNames": ["gcc-11"],
"registryUrls": [
"https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64"
secustor marked this conversation as resolved.
Show resolved Hide resolved
]
}
]
}
```

## Artifactory

This datasource can also be used with Artifactory.
secustor marked this conversation as resolved.
Show resolved Hide resolved
The supported repository types are:
secustor marked this conversation as resolved.
Show resolved Hide resolved

- virtual
- local
- remote

If you are using Artifactory, you can use the `deb` datasource with following `registryUrl` format:
secustor marked this conversation as resolved.
Show resolved Hide resolved

```
secustor marked this conversation as resolved.
Show resolved Hide resolved
https://<host>:<port>/artifactory/<repository-slug>?suite=<suite>&components=<components>&binaryArch=<binaryArch>
secustor marked this conversation as resolved.
Show resolved Hide resolved
https://artifactory.example.com:443/artifactory/debian/?release=bookworm&components=main,contrib,non-free&binaryArch=amd64
secustor marked this conversation as resolved.
Show resolved Hide resolved
```

Further, you have to set up a host rule to authenticate against Artifactory.
Use the "Set Me Up" feature in Artifactory to generate a password for Renovate.
secustor marked this conversation as resolved.
Show resolved Hide resolved
Then add the following configuration:
secustor marked this conversation as resolved.
Show resolved Hide resolved

```json title="Artifactory host rule configuration with username and password"
secustor marked this conversation as resolved.
Show resolved Hide resolved
{
"hostRules": [
{
"hostType": "deb",
"matchHost": "https://artifactory.example.com:443/artifactory/debian",
"username": "myuser",
"password": "< the generated password >"
}
]
}
```