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

Renovate integration #34

Open
strausmann opened this issue Jul 9, 2024 · 6 comments
Open

Renovate integration #34

strausmann opened this issue Jul 9, 2024 · 6 comments

Comments

@strausmann
Copy link
Contributor

Have you ever thought about integrating Renovate?

This would allow you to update the dependencies automatically. I use this in many of my GitLab projects.
Among others also for my Bedrock Connect Docker image, which uses some of your projects.

https://docs.renovatebot.com/

@itzg
Copy link
Owner

itzg commented Jul 9, 2024

I already use dependabot.

How does this help with versions of dependencies buried within RUN statements in Dockerfile's?

@itzg
Copy link
Owner

itzg commented Jul 9, 2024

Wanted to link to this very helpful example you included in other convo

itzg/mc-monitor#90 (comment)

@strausmann
Copy link
Contributor Author

@strausmann
Copy link
Contributor Author

@strausmann
Copy link
Contributor Author

Here is a link to my Renovate Config Repo. I have revised the config for Dockerfile dependencies again and found better ways to do it. For this purpose, I have made the config from the one project, now global for my projects.

The interaction is now the Global Config project and the Dockerfile files in my Bedrock Connect project

Global Renovate Config:
https://git.strausmann.de/renovate/renovate-config/-/blob/main/default.json?ref_type=heads

Project Renovate Config:
https://git.strausmann.de/minecraft/bedrock-connect/-/blob/main/renovate.json?ref_type=heads

Project Dockerfile:
https://git.strausmann.de/minecraft/bedrock-connect/-/blob/main/image/Dockerfile?ref_type=heads

Please note that the line before an ARG or ENV in a Dockerfile must be

# renovate: datasource=github-releases depName=itzg/easy-add versioning=loose

This tells the renovate that the following ENV or ARG variable should be updated if this variable ends with _VERSION. You can specify different sources as Datasource, depName is the path owner/project name and versioning=loose says that it tries to use semver, otherwise it sorts the tags and takes the first value from the sorting.

In your ENTRYPOINT_DEMOTER project, extractVersion had to be added because you use a "v" before the version here.

# renovate: datasource=github-releases depName=itzg/entrypoint-demoter versioning=loose extractVersion=(^v(?<version>.*)$)

I'm not entirely happy with this solution, because it's always an additional layer. However, this now happens automatically for my project.

With this PackageRule I have also combined all your modules in my project into a MergeRequest and defined it as a fix for deps, which triggers a new release at night when Semantic-Releases sees the commit.

https://git.strausmann.de/renovate/renovate-config/-/blob/5f3d9ff7986618c6f8b98375fe02f83233a0e7ae/default.json#L28-L34

With the following CustomManagers rule set, the Renovate comment is recognized in the Dockerfile.

https://git.strausmann.de/renovate/renovate-config/-/blob/5f3d9ff7986618c6f8b98375fe02f83233a0e7ae/default.json#L37-L44

@itzg
Copy link
Owner

itzg commented Jul 11, 2024

In your ENTRYPOINT_DEMOTER project, extractVersion had to be added because you use a "v" before the version here.

I'll look into changing that. That was a Go-ism that I never really liked in the first place. As you see I have switched or didn't adopt that convention on most of the projects now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants