Skip to content

Commit 4271cb0

Browse files
committed
feat: add renovate files
1 parent 42f76e3 commit 4271cb0

12 files changed

+211
-0
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
max_line_length = 140
11+
end_of_line = lf
12+
13+
[*.{shim,bat,cmd}]
14+
end_of_line = crlf

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.sh text eol=lf
2+
*.bat text eol=crlf
3+
*.cmd text eol=crlf

.github/renovate.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["visualon/renovate-config", "visualon/renovate-config:automergePatch"],
4+
"platformAutomerge": true,
5+
"automergeType": "pr",
6+
"prCreation": "immediate",
7+
"schedule": ["at any time"],
8+
"labels": ["deps"],
9+
"digest": {
10+
"extends": ["schedule:daily"]
11+
},
12+
"packageRules": [
13+
{
14+
"packageNames": ["renovate", "renovate/renovate", "renovatebot/internal-tools"],
15+
"extends": [":automergeMajor"],
16+
"stabilityDays": 0,
17+
"dependencyDashboardApproval": false
18+
},
19+
{
20+
"packageNames": [
21+
"ghcr.io/containerbase/buildpack",
22+
"node",
23+
"yarn"
24+
],
25+
"extends": [":automergeMinor"]
26+
}
27+
]
28+
}

.github/workflows/build.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: build
2+
3+
on:
4+
push:
5+
6+
env:
7+
OWNER: ${{ github.repository_owner }}
8+
FILE: renovate
9+
IMAGE: ghcr.io/${{ github.repository_owner }}/renovate
10+
BUILDKIT_PROGRESS: plain
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
18+
linux:
19+
runs-on: ubuntu-latest
20+
21+
timeout-minutes: 30
22+
23+
env:
24+
TAG: latest
25+
26+
steps:
27+
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
28+
29+
- name: Init
30+
run: ./bin/init.sh
31+
shell: bash
32+
33+
- name: docker-config
34+
uses: renovatebot/internal-tools@398845862f453798d77377861116d2aa064bc814 # tag=v1.14.7
35+
with:
36+
command: docker-config
37+
38+
- name: Build the Docker image
39+
run: docker buildx bake test
40+
41+
- name: Test run
42+
run: docker-compose --file docker-compose.test.yml run sut
43+
env:
44+
IMAGE: ${{ env.IMAGE }}:${{ env.TAG }}
45+
46+
- name: Log into registry
47+
if: github.ref == 'refs/heads/main'
48+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
49+
50+
- name: Publish the Docker image
51+
if: github.ref == 'refs/heads/main'
52+
run: docker buildx bake build

.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM renovate/renovate:34.34.0-slim@sha256:20484f2389994811ccd08c83ec8b440f3c6c531865f149c51abb84fb6099aba4
2+
3+
LABEL maintainer="Michael Kriese <[email protected]>"
4+
5+
# USER root
6+
# RUN prepare-tool dotnet
7+
8+
# USER ${USER_ID}
9+
10+
# # renovate: datasource=node
11+
# RUN install-tool node 18.12.1
12+
13+
# renovate: datasource=npm
14+
RUN install-tool corepack 0.15.1

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# docker-renovate
2+
23
Custom renovate images with some prepared tools

bin/init.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
FROM=$(grep 'FROM renovate/renovate:' Dockerfile)
5+
SEMVER_REGEX=":(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)-"
6+
7+
8+
if ! [[ "$FROM" =~ $SEMVER_REGEX ]]; then
9+
echo Not a semver tag - skipping
10+
exit
11+
fi
12+
13+
major=${BASH_REMATCH[1]}
14+
minor=${BASH_REMATCH[2]}
15+
patch=${BASH_REMATCH[3]}
16+
17+
18+
VERSION="${major}.${minor}.${patch}"
19+
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
20+
echo "Found version: ${VERSION}"

bin/update-executables.ps1

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Get-ChildItem *.sh -Recurse `
2+
| Where-Object { $_.FullName -notlike '*\node_modules\*' } `
3+
| ForEach-Object {
4+
git update-index --chmod=+x (Resolve-Path $_.FullName -Relative)
5+
}

docker-bake.hcl

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
variable "OWNER" {
2+
default = "visualon"
3+
}
4+
variable "FILE" {
5+
default = "renovate"
6+
}
7+
variable "TAG" {
8+
default = "latest"
9+
}
10+
variable "VERSION" {
11+
default = ""
12+
}
13+
14+
group "default" {
15+
targets = ["build_ghcr", "build_docker"]
16+
}
17+
18+
group "build" {
19+
targets = ["build_ghcr", "build_docker", "push_ghcr"]
20+
}
21+
22+
group "push" {
23+
targets = ["push_ghcr"]
24+
}
25+
26+
group "test" {
27+
targets = ["build_docker"]
28+
}
29+
30+
target "settings" {
31+
inherits = ["settings"]
32+
cache-from = [
33+
"type=registry,ref=ghcr.io/${OWNER}/cache:${FILE}",
34+
"type=registry,ref=ghcr.io/${OWNER}/cache:${FILE}-${TAG}",
35+
"type=registry,ref=ghcr.io/${OWNER}/cache:${FILE}-${VERSION}",
36+
]
37+
}
38+
39+
target "build_ghcr" {
40+
inherits = ["settings"]
41+
output = ["type=registry"]
42+
tags = [
43+
"ghcr.io/${OWNER}/cache:${FILE}-${TAG}",
44+
notequal("", VERSION) ? "ghcr.io/${OWNER}/cache:${FILE}-${VERSION}" : "",
45+
]
46+
cache-to = ["type=inline,mode=max"]
47+
}
48+
49+
target "build_docker" {
50+
inherits = ["settings"]
51+
output = ["type=docker"]
52+
tags = [
53+
"ghcr.io/${OWNER}/${FILE}:${TAG}",
54+
notequal("", VERSION) ? "ghcr.io/${OWNER}/${FILE}:${VERSION}" : "",
55+
]
56+
}
57+
58+
target "push_ghcr" {
59+
inherits = ["settings"]
60+
output = ["type=registry"]
61+
tags = [
62+
"ghcr.io/${OWNER}/${FILE}:${TAG}",
63+
notequal("", VERSION) ? "ghcr.io/${OWNER}/${FILE}:${VERSION}" : "",
64+
]
65+
}

docker-compose.test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
services:
2+
sut:
3+
image: '${IMAGE}'
4+
command: renovate --version

0 commit comments

Comments
 (0)