Add Renovate for dependency management (#593)

This commit is contained in:
Franck Nijhof 2023-03-25 11:08:59 +01:00 committed by GitHub
parent 0e49d1ea50
commit 17de42d37d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 138 additions and 15 deletions

View file

@ -1,13 +0,0 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "06:00"
- package-ecosystem: "pip"
directory: "/vscode"
schedule:
interval: daily
time: "06:00"

134
.github/renovate.json vendored Normal file
View file

@ -0,0 +1,134 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": ["dependencies", "no-stale"],
"commitMessagePrefix": "⬆️",
"commitMessageTopic": "{{depName}}",
"regexManagers": [
{
"fileMatch": ["/Dockerfile$", "/build.yaml$"],
"matchStringsStrategy": "any",
"matchStrings": [
"ARG BUILD_FROM=(?<depName>.*?):(?<currentValue>.*?)\\s+",
"(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?<depName>.*?):(?<currentValue>.*?)[\"']?\\s"
],
"datasourceTemplate": "docker"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStringsStrategy": "any",
"matchStrings": [
"\\s\\s(?<package>[a-z0-9][a-z0-9-]+)=(?<currentValue>[a-z0-9-:_+~.]+)\\s+"
],
"versioningTemplate": "deb",
"datasourceTemplate": "repology",
"depNameTemplate": "debian_11/{{package}}"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStrings": [
"ARG CODE_SERVER_VERSION=[\"']?(?<currentValue>.+?)[\"']?\\s+"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "cdr/code-server"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStrings": [
"ARG HA_CLI_VERSION=[\"']?(?<currentValue>.+?)[\"']?\\s+"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "home-assistant/cli",
"versioningTemplate": "loose"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": ["emilast\\.LogFileHighlighter#(?<currentValue>.+)\\s"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "emilast/vscode-logfile-highlighter"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": ["esbenp\\.prettier-vscode#(?<currentValue>.+)\\s"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "prettier/prettier-vscode"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": ["ESPHome\\.esphome-vscode#(?<currentValue>.+)\\s"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "esphome/esphome-vscode",
"versioningTemplate": "loose"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": [
"keesschollaart\\.vscode-home-assistant#(?<currentValue>.+)\\s"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "keesschollaart81/vscode-home-assistant"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": [
"lukas-tr\\.materialdesignicons-intellisense#(?<currentValue>.+)\\s"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "lukas-tr/vscode-materialdesignicons-intellisense"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": ["netcorext\\.uuid-generator#(?<currentValue>.+)\\s"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "arenchen/vscode-uuid-generator"
},
{
"fileMatch": ["vscode/vscode.extensions$"],
"matchStrings": ["usernamehw\\.errorlens#(?<currentValue>.+)\\s"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "usernamehw/vscode-error-lens"
}
],
"packageRules": [
{
"matchDatasources": ["repology"],
"automerge": true
},
{
"groupName": "Add-on base image",
"matchDatasources": ["docker"]
},
{
"groupName": "Add-on base image",
"matchDatasources": ["docker"],
"matchUpdateTypes": ["patch"],
"automerge": true
},
{
"matchDatasources": ["github-releases"],
"matchDepNames": ["cdr/code-server"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchDatasources": ["github-releases"],
"matchDepNames": ["home-assistant/cli"],
"automerge": true
},
{
"matchManagers": ["pip_requirements"],
"addLabels": ["python"]
},
{
"matchManagers": ["pip_requirements"],
"matchDepTypes": ["dev"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["pip_requirements"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}
]
}

View file

@ -19,6 +19,8 @@ COPY vscode.extensions /root/vscode.extensions
# Setup base system # Setup base system
ARG BUILD_ARCH=amd64 ARG BUILD_ARCH=amd64
ARG CODE_SERVER_VERSION="v4.11.0"
ARG HA_CLI_VERSION="4.23.0"
# hadolint ignore=SC2181, DL3008 # hadolint ignore=SC2181, DL3008
RUN \ RUN \
apt-get update \ apt-get update \
@ -54,7 +56,7 @@ RUN \
&& if [[ "${BUILD_ARCH}" = "aarch64" ]]; then ARCH="arm64"; fi \ && if [[ "${BUILD_ARCH}" = "aarch64" ]]; then ARCH="arm64"; fi \
&& if [[ "${BUILD_ARCH}" = "amd64" ]]; then ARCH="amd64"; fi \ && if [[ "${BUILD_ARCH}" = "amd64" ]]; then ARCH="amd64"; fi \
&& curl -J -L -o /tmp/code.tar.gz \ && curl -J -L -o /tmp/code.tar.gz \
"https://github.com/cdr/code-server/releases/download/v4.11.0/code-server-4.11.0-linux-${ARCH}.tar.gz" \ "https://github.com/cdr/code-server/releases/download/${CODE_SERVER_VERSION}/code-server-${CODE_SERVER_VERSION#v}-linux-${ARCH}.tar.gz" \
&& mkdir -p /usr/local/lib/code-server \ && mkdir -p /usr/local/lib/code-server \
&& tar zxvf \ && tar zxvf \
/tmp/code.tar.gz \ /tmp/code.tar.gz \
@ -86,7 +88,7 @@ RUN \
&& ls -la /usr/local/lib/code-server/lib/vscode/extensions/ \ && ls -la /usr/local/lib/code-server/lib/vscode/extensions/ \
\ \
&& curl -L -s -o /usr/bin/ha \ && curl -L -s -o /usr/bin/ha \
"https://github.com/home-assistant/cli/releases/download/4.23.0/ha_${BUILD_ARCH}" \ "https://github.com/home-assistant/cli/releases/download/${HA_CLI_VERSION}/ha_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/ha \ && chmod a+x /usr/bin/ha \
\ \
&& git clone --branch master --single-branch --depth 1 \ && git clone --branch master --single-branch --depth 1 \