Setting up Renovate On-Prem for GitLab.com on Fly.io
I've written about being a huge fan of Renovate before, and have been using it personally and professionally for a few years.
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.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.