Closed mcritchlow closed 4 years ago
You can use a more generic regexManager, like we do ourself.
Dockerfile
# renovate: datasource=docker depName=ruby versioning=ruby
ARG RUBY_VERSION=2.6.6
FROM ruby:$RUBY_VERSION-alpine as shoreline
config
"regexManagers": [
{
"fileMatch": ["(^|/|\\.)Dockerfile$", "(^|/)Dockerfile\\.[^/]*$"],
"matchStrings": [
"# renovate: datasource=(?<datasource>[a-z-]+?) depName=(?<depName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s(?:ENV|ARG) .+?_VERSION=(?<currentValue>.+?)\\s"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
},
]
@viceice - Thank you, I'll give that a try!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs.
The proposed config will work for us, thanks again for the suggestion!
Which Renovate are you using?
WhiteSource Renovate App
Which platform are you using?
GitLab.com
Have you checked the logs? Don't forget to include them if relevant
Example log snippet of a
Dockerfile
that would ideally have been updated:What would you like to do?
Hello, in this gitlab repository we have several
Dockerfile
's for different products (it's a monorepo).The ruby-based
Dockerfile
's take the form:I'm trying to use the new
regexManager
option to teach Renovate to update theRUBY_VERSION
argument. The configuration I'm attempting to use is:While it's not ideal that the
-alpine
suffix isn't matched by thecurrentValue
, I was hoping this wouldn't be a problem since theruby
container image always keeps the Alpine versions in sync.That said, what I'm getting are logs as shown above.
I realize I could probably put the entire image reference in the
ARG
, like:ruby:2.6.6-alpine
and change theFROM
line to:FROM $RUBY_VERSION as shoreline
, but we never change either the base image (ruby
) or the OS-variantalpine
.I'm curious if there's a way to achieve what I'm after using
regexManager
. Thanks in advance for any guidance!