Setting up Renovate On-Prem for GitLab.com on Fly.io

Featured image for sharing metadata for article

I've written about being a huge fan of Renovate before, and have been using it personally and professionally for a few years.

I first set up Renovate for my personal GitLab.com projects using the official GitLab setup, which followed the original way I set up Renovate at Deliveroo using the Renovate GitHub Action.

This model works well for a while, but at some point, losing out on the real-time updates on Pull/Merge Requests or through the Dependency Dashboard can make the app feel rather sluggish, especially if you've been using the hosted app on GitHub.

Fortunately Mend, the company behind Renovate, provide a free tool called Renovate On-Prem which wraps the Renovate Open Source project with the ability to react real-time to notifications.

The last couple of days I was clearing down the backlog of dependency updates I had to do in dependency-management-data and found that conflicts in the go.mod and go.sum between different dependency updates meant the upgrade process was fairly slow.

Because I've run Renovate On-Prem before at work, I set about doing the same for my Open Source projects.

I've been using Fly.io for hosting all my apps recently, so set about doing the same for Renovate On-Prem. All the code and config below can be found in the repo on GitLab.com.

We can use the following Dockerfile for the app:

FROM whitesource/renovate:5.0.1

# defaults
ENV ACCEPT_WHITESOURCE_TOS=y
ENV RENOVATE_PLATFORM=gitlab
ENV RENOVATE_ENDPOINT=https://gitlab.com/api/v4/

# personal configuration
ENV SCHEDULER_CRON='0 * * * *'
ENV RENOVATE_EXTRA_FLAGS=--autodiscover=true

# secrets
ARG LICENSE_KEY
ARG RENOVATE_TOKEN
ARG GITHUB_COM_TOKEN
ARG WEBHOOK_SECRET

EXPOSE 8080

Then, we can specify the secrets needed by Renovate with i.e.

flyctl secrets set WEBHOOK_SECRET=.....

You should scale down to 1 instance (as it doesn't horizontally scale):

flyctl scale count

And I've found that 512MB is a good amount of memory to set for Renovate On-Prem to work (it crashes with Out Of Memory (OOM) errors with the default minimal memory limit Fly gives you):

fly scale vm shared-cpu-2x
flyctl scale memory 512

The Renovate On-Prem documentation for GitLab covers the definition of the variables, and what you need to do to get Webhooks set up.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #renovate #fly.io #gitlab.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.