From 90a2c87377d90d998825c84d2143b5069f8609f7 Mon Sep 17 00:00:00 2001 From: secustor Date: Thu, 29 Aug 2024 20:55:52 +0200 Subject: [PATCH 01/12] docs(datasource/deb): document steps for Artifactory --- lib/modules/datasource/deb/readme.md | 49 ++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index d46c68e48a0318..864893a9a9a34a 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -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. +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. **Registry URL** -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`: - `components`: Comma-separated list of repository components (e.g., `main,contrib,non-free`). - `binaryArch`: Architecture of the binary packages (e.g., `amd64`,`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. @@ -34,6 +36,7 @@ First you would set a custom manager in your `renovate.json` file for `Dockerfil "matchStrings": [ "#\\s*renovate:\\s*?depName=(?.*?)?\\sENV .*?_VERSION=\"(?.*)\"\\s" ], + "registryUrlTemplate": "https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64", "datasourceTemplate": "deb" } ] @@ -55,3 +58,43 @@ RUN apt-get update && \ ``` When the apt package for `gcc` is updated, Renovate updates the environment variable. + +```json title="Overwrite deb registryUrl via packageRule" +{ + "packageRules": [ + { + "matchDatasources": ["deb"], + "matchPackageNames": ["gcc-11"], + "registryUrls": [ + "https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64" + ] + } + ] +} +``` + +## Artifactory + +If you are using Artifactory, you can use the `deb` datasource with following `registryUrl` format: + +``` +https://:/artifactory/?suite=&components=&binaryArch= +https://artifactory.example.com:443/artifactory/debian/?release=bookworm&components=main,contrib,non-free&binaryArch=amd64 +``` + +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. +Then add the following configuration: + +```json title="Artifactory host rule configuration with username and password" +{ + "hostRules": [ + { + "hostType": "deb", + "matchHost": "https://artifactory.example.com:443/artifactory/debian", + "username": "myuser", + "password": "< the generated password >" + } + ] +} +``` From 5de2b8cec26edd052e75509f599452f6e27c398d Mon Sep 17 00:00:00 2001 From: secustor Date: Thu, 29 Aug 2024 20:59:46 +0200 Subject: [PATCH 02/12] docs(datasource/deb): document supported repository types --- lib/modules/datasource/deb/readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 864893a9a9a34a..f8872367438b33 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -75,6 +75,12 @@ When the apt package for `gcc` is updated, Renovate updates the environment vari ## Artifactory +This datasource can also be used with Artifactory. +The supported repository types are: +- virtual +- local +- remote + If you are using Artifactory, you can use the `deb` datasource with following `registryUrl` format: ``` From 8a29f5458c06fd86f923cc3e8c4464f035f8093a Mon Sep 17 00:00:00 2001 From: secustor Date: Thu, 29 Aug 2024 21:21:42 +0200 Subject: [PATCH 03/12] fix prettier --- lib/modules/datasource/deb/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index f8872367438b33..8f7fc7ce43732b 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -77,6 +77,7 @@ When the apt package for `gcc` is updated, Renovate updates the environment vari This datasource can also be used with Artifactory. The supported repository types are: + - virtual - local - remote From e822bd0835948bbf085c33877686c9d4da152a0f Mon Sep 17 00:00:00 2001 From: secustor Date: Fri, 30 Aug 2024 11:56:17 +0200 Subject: [PATCH 04/12] docs: allow to set release in comment --- lib/modules/datasource/deb/readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 8f7fc7ce43732b..082c20073815c4 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -34,9 +34,9 @@ First you would set a custom manager in your `renovate.json` file for `Dockerfil "customType": "regex", "fileMatch": ["^Dockerfile$"], "matchStrings": [ - "#\\s*renovate:\\s*?depName=(?.*?)?\\sENV .*?_VERSION=\"(?.*)\"\\s" + "#\\s*renovate:\\s*?(release=(?.*?))?\\s*depName=(?.*?)?\\sENV .*?_VERSION=\"(?.*)\"" ], - "registryUrlTemplate": "https://deb.debian.org/debian?suite=stable&components=main,contrib,non-free&binaryArch=amd64", + "registryUrlTemplate": "https://deb.debian.org/debian?{{#if release }}release={{release}}{{else}}suite=stable{{/if}}&components=main,contrib,non-free&binaryArch=amd64", "datasourceTemplate": "deb" } ] @@ -48,7 +48,7 @@ Then you would put comments in your Dockerfile, to tell Renovate where to find t ```dockerfile FROM debian:bullseye -# renovate: depName=gcc-11 +# renovate: release=bullseye depName=gcc-11 ENV GCC_VERSION="11.2.0-19" RUN apt-get update && \ @@ -85,13 +85,13 @@ The supported repository types are: If you are using Artifactory, you can use the `deb` datasource with following `registryUrl` format: ``` -https://:/artifactory/?suite=&components=&binaryArch= -https://artifactory.example.com:443/artifactory/debian/?release=bookworm&components=main,contrib,non-free&binaryArch=amd64 +https://:/artifactory/?release=&components=&binaryArch= +https://artifactory.example.com:443/artifactory/debian?release=bookworm&components=main,contrib,non-free&binaryArch=amd64 ``` -Further, you have to set up a host rule to authenticate against Artifactory. +Additionally, if the Artifactory requires authentication, you need to set up a host rule. Use the "Set Me Up" feature in Artifactory to generate a password for Renovate. -Then add the following configuration: +Then, add the following configuration: ```json title="Artifactory host rule configuration with username and password" { From e1ec718206eea6e75b36d192024b094eb41297a0 Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Fri, 30 Aug 2024 18:17:58 +0200 Subject: [PATCH 05/12] Apply suggestions from code review Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- lib/modules/datasource/deb/readme.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 082c20073815c4..c459056e2f418b 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -1,9 +1,12 @@ -The Debian datasource enables Renovate to update packages from Debian repositories. -It is ideal for projects that depend on Debian-based systems or distributions. +Renovate uses the Debian datasource to update packages from Debian repositories. +The `debian` datasource is meant for projects that: + +- depend on Debian-based systems, or +- depend on Debian-based distributions, like Ubuntu You will need to combine Debian datasource with [regex managers](../../manager/regex/index.md) to update dependencies. **Registry URL** -To use a Debian repository with the datasource, you need a properly formatted URL with specific query parameters as `registryUrl`: +To use a Debian repository with the datasource, you must set a properly formatted URL with specific query parameters as `registryUrl`: - `components`: Comma-separated list of repository components (e.g., `main,contrib,non-free`). - `binaryArch`: Architecture of the binary packages (e.g., `amd64`,`all`). @@ -59,7 +62,7 @@ RUN apt-get update && \ When the apt package for `gcc` is updated, Renovate updates the environment variable. -```json title="Overwrite deb registryUrl via packageRule" +```json title="Override deb registryUrl with a packageRules entry" { "packageRules": [ { @@ -76,24 +79,30 @@ When the apt package for `gcc` is updated, Renovate updates the environment vari ## Artifactory This datasource can also be used with Artifactory. -The supported repository types are: +### Supported repository types + +The `debian` datasource supports these repository types: - virtual - local - remote -If you are using Artifactory, you can use the `deb` datasource with following `registryUrl` format: +### Set a `registryUrl` + +To use Artifactory, first configure the `deb` datasource by setting the `registryUrl`. ``` https://:/artifactory/?release=&components=&binaryArch= https://artifactory.example.com:443/artifactory/debian?release=bookworm&components=main,contrib,non-free&binaryArch=amd64 ``` -Additionally, if the Artifactory requires authentication, you need to set up a host rule. -Use the "Set Me Up" feature in Artifactory to generate a password for Renovate. +### Authenticating to Artifactory + +If Artifactory asks for authentication, you must set up a host rule. +First, generate a password for Renovate with Artifactory's "Set Me Up" feature. Then, add the following configuration: -```json title="Artifactory host rule configuration with username and password" +```json title="Example Artifactory host rule configuration, with username and password" { "hostRules": [ { From 9b6ad92ed7b8d3aed6cad3aac9030bef46723ca2 Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Fri, 30 Aug 2024 18:19:16 +0200 Subject: [PATCH 06/12] Apply suggestions from code review --- lib/modules/datasource/deb/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index c459056e2f418b..0226a722f359a7 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -78,7 +78,7 @@ When the apt package for `gcc` is updated, Renovate updates the environment vari ## Artifactory -This datasource can also be used with Artifactory. +The Debian datasource can be used with Artifactory. ### Supported repository types The `debian` datasource supports these repository types: From c41433622a18faf8ab98639b9c82dff0a33b4094 Mon Sep 17 00:00:00 2001 From: secustor Date: Fri, 30 Aug 2024 18:23:50 +0200 Subject: [PATCH 07/12] implement suggestions --- lib/modules/datasource/deb/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 0226a722f359a7..ac548e1ee242c4 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -91,7 +91,7 @@ The `debian` datasource supports these repository types: To use Artifactory, first configure the `deb` datasource by setting the `registryUrl`. -``` +``` title="Example of valid registryUrl format" https://:/artifactory/?release=&components=&binaryArch= https://artifactory.example.com:443/artifactory/debian?release=bookworm&components=main,contrib,non-free&binaryArch=amd64 ``` From b12baf4157fe8c363e7b693c4d0787edd446cee1 Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Sun, 1 Sep 2024 15:48:35 +0200 Subject: [PATCH 08/12] Update lib/modules/datasource/deb/readme.md Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- lib/modules/datasource/deb/readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index ac548e1ee242c4..64255706de8cbe 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -3,7 +3,8 @@ The `debian` datasource is meant for projects that: - depend on Debian-based systems, or - depend on Debian-based distributions, like Ubuntu -You will need to combine Debian datasource with [regex managers](../../manager/regex/index.md) to update dependencies. +By default, Renovate does not detect Debian dependencies. +For Renovate to update dependencies, you must combine the Debian datasource with [regex managers](../../manager/regex/index.md). **Registry URL** To use a Debian repository with the datasource, you must set a properly formatted URL with specific query parameters as `registryUrl`: From 284ec41234f70aeb2738b55960efd42b58051e44 Mon Sep 17 00:00:00 2001 From: secustor Date: Sun, 1 Sep 2024 18:12:17 +0200 Subject: [PATCH 09/12] fix prettier --- lib/modules/datasource/deb/readme.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 64255706de8cbe..e31ba0b9756357 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -3,8 +3,8 @@ The `debian` datasource is meant for projects that: - depend on Debian-based systems, or - depend on Debian-based distributions, like Ubuntu -By default, Renovate does not detect Debian dependencies. -For Renovate to update dependencies, you must combine the Debian datasource with [regex managers](../../manager/regex/index.md). + By default, Renovate does not detect Debian dependencies. + For Renovate to update dependencies, you must combine the Debian datasource with [regex managers](../../manager/regex/index.md). **Registry URL** To use a Debian repository with the datasource, you must set a properly formatted URL with specific query parameters as `registryUrl`: @@ -80,6 +80,7 @@ When the apt package for `gcc` is updated, Renovate updates the environment vari ## Artifactory The Debian datasource can be used with Artifactory. + ### Supported repository types The `debian` datasource supports these repository types: @@ -92,7 +93,7 @@ The `debian` datasource supports these repository types: To use Artifactory, first configure the `deb` datasource by setting the `registryUrl`. -``` title="Example of valid registryUrl format" +```title="Example of valid registryUrl format" https://:/artifactory/?release=&components=&binaryArch= https://artifactory.example.com:443/artifactory/debian?release=bookworm&components=main,contrib,non-free&binaryArch=amd64 ``` From 14bbf8eafd37124324521072ebc7ae21d91cc459 Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Mon, 9 Sep 2024 20:12:58 +0200 Subject: [PATCH 10/12] Apply suggestions from code review Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- lib/modules/datasource/deb/readme.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index e31ba0b9756357..85d72aa2c32f3d 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -3,10 +3,11 @@ The `debian` datasource is meant for projects that: - depend on Debian-based systems, or - depend on Debian-based distributions, like Ubuntu - By default, Renovate does not detect Debian dependencies. - For Renovate to update dependencies, you must combine the Debian datasource with [regex managers](../../manager/regex/index.md). -**Registry URL** +By default, Renovate does not detect Debian dependencies. +For Renovate to update dependencies, you must combine the Debian datasource with [regex managers](../../manager/regex/index.md). + +## Set URL when using a Debian repository To use a Debian repository with the datasource, you must set a properly formatted URL with specific query parameters as `registryUrl`: - `components`: Comma-separated list of repository components (e.g., `main,contrib,non-free`). From b93219006c354fdd30d97e62355b37555f6c8ac2 Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Wed, 11 Sep 2024 15:14:46 +0200 Subject: [PATCH 11/12] Update lib/modules/datasource/deb/readme.md Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- lib/modules/datasource/deb/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 85d72aa2c32f3d..676d2073fae4ed 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -8,6 +8,7 @@ By default, Renovate does not detect Debian dependencies. For Renovate to update dependencies, you must combine the Debian datasource with [regex managers](../../manager/regex/index.md). ## Set URL when using a Debian repository + To use a Debian repository with the datasource, you must set a properly formatted URL with specific query parameters as `registryUrl`: - `components`: Comma-separated list of repository components (e.g., `main,contrib,non-free`). From 0cf915cb0a776b6b0bce2272376d5faad141cff2 Mon Sep 17 00:00:00 2001 From: secustor Date: Mon, 16 Sep 2024 22:38:49 +0200 Subject: [PATCH 12/12] docs: added note panel --- lib/modules/datasource/deb/readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/modules/datasource/deb/readme.md b/lib/modules/datasource/deb/readme.md index 676d2073fae4ed..8e21be5c848401 100644 --- a/lib/modules/datasource/deb/readme.md +++ b/lib/modules/datasource/deb/readme.md @@ -17,6 +17,11 @@ To use a Debian repository with the datasource, you must set a properly formatte - `suite`: A rolling release alias like `stable`. - `release`: A fixed release name such as `bullseye` or `buster`. + +!!! note + These parameters are used to give Renovate context and are not directly used to call the repository. + Therefore, the `registryUrl` has not to be a valid URL for a repository. + **Example**: ```