添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

We're providing GitLab CI/CD templates ("pipeline modules") to customers inside our organisation. These templates possess unique names, are of a specific type and are uniquely versioned, i.e. no artifact can have the same version as another. Also multiple release channels exist. A version consists of major.minor.patch values suffixed by -<timestamp>-<short-commit-hash> (this is the preferred way to version artifacts inside our organisation). I.e. a valid version could be 3.0.36-20220509094357-6c081b1 . This versioning isn't pure semver, but renovate should be able to handle it using the loose versioning as far as I could tell.

The structure in which our artifacts are released looks like this:
https://artifactory.myorg/artifactory/<my-registry>/<release-channel>/<pipeline-module-type>/<pipeline-module-name>/<version>.yaml where all the values are provided inside the included string.

This would be an example of a .gitlab-ci.yml file to be renovated:

include : # include of a pipeline module - https://artifactory.myorg/artifactory/my-registry/canary/jobs/lint_yaml/0.1.2-20220509094357-6c081b1.yaml

What I'd like to achieve is for these templates to get updated by renovate via a custom regex manager. I've tried endlessly creating one, judging from renovate's logoutput it also seemed to have extracted all the values as it should have. But it always skips the dependency with "skipReason": "invalid-config" .
I would very much appreciate it if someone who knows the inner workings can help me identify the issue.

Here's the last version of the custom regex manager I've used, defined in a test-project's renovate.json:

"$schema" : " https://docs.renovatebot.com/renovate-schema.json " , "regexManagers" : [ "fileMatch" : [ " ^.gitlab-ci.yml$ " ], "matchStrings" : [ " (?<datasource>https: \/\/ artifactory \. myorg \/ artifactory \/ my-registry?) \/ (?<depType>.* \/ .*?) \/ (?<depName>.*?) \/ (?<currentValue>.*?)( \. yaml) " "versioningTemplate" : " loose "

I've also validated this using regex101.com, which also extracts the values correctly as follows:

  • datasource= https://artifactory.myorg/artifactory/my-registry
  • depType= canary/jobs
  • depName= lint_yaml
  • currentValue= 0.1.2-20220509094357-6c081b1
  • Any pointers as to why this isn't working would be highly appreciated!

    I managed to make it work. For anyone else wondering, this is the config that worked for me:

    "$schema" : " https://docs.renovatebot.com/renovate-schema.json " , "regexManagers" : [ "fileMatch" : [ " ^.gitlab-ci.yml$ " ], "matchStrings" : [ " https: \\ / \\ /artifactory \\ .myorg \\ /artifactory \\ /my-registry \\ /(?<depName>.* \\ /.* \\ /.*?) \\ /(?<currentValue>.* \\ .yaml?) " "datasourceTemplate" : " artifactory " , "registryUrlTemplate" : " https://artifactory.myorg/artifactory/my-registry/ " , "versioningTemplate" : " loose "

    Hi, thanks for the answer. I realize that I'm using it wrong, which is why I asked the question in the first place. I can't use GitLab tags or releases because the files are stored in Artifactory and GitLab doesn't hold any information on the existing versions and where the corresponding files are stored.
    I've set the datasourceTemplate to artifactory and removed the datasource regex capture group in the matchString, now at least I get a different error: Failed to lookup dependency.
    Any further advice?

    I managed to make it work. For anyone else wondering, this is the config that worked for me:

    "$schema" : " https://docs.renovatebot.com/renovate-schema.json " , "regexManagers" : [ "fileMatch" : [ " ^.gitlab-ci.yml$ " ], "matchStrings" : [ " https: \\ / \\ /artifactory \\ .myorg \\ /artifactory \\ /my-registry \\ /(?<depName>.* \\ /.* \\ /.*?) \\ /(?<currentValue>.* \\ .yaml?) " "datasourceTemplate" : " artifactory " , "registryUrlTemplate" : " https://artifactory.myorg/artifactory/my-registry/ " , "versioningTemplate" : " loose "