Skip to content

Commit f2a63f0

Browse files
authored
Merge pull request #21 from OpenVoxProject/refactor_for_renovate
feat: refactor for renovate version automated updating
2 parents 1b46f2e + 5e5b584 commit f2a63f0

File tree

7 files changed

+79
-34
lines changed

7 files changed

+79
-34
lines changed

.github/workflows/build_container.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ jobs:
1717
- name: Source checkout
1818
uses: actions/checkout@v4
1919

20+
- name: 'Setup yq'
21+
uses: dcarbone/[email protected]
22+
2023
- id: set-matrix
21-
run: echo "matrix=$(cat build_versions.json | jq -c)" >> $GITHUB_OUTPUT
24+
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
2225

2326
build-X86-container:
2427
runs-on: ubuntu-24.04
@@ -89,13 +92,23 @@ jobs:
8992
username: ${{ github.repository_owner }}
9093
password: ${{ secrets.GITHUB_TOKEN }}
9194

95+
- name: Extract version number
96+
id: extract_version
97+
uses: actions/github-script@v7
98+
with:
99+
script: |
100+
const agentVersion = '${{ matrix.server_version }}';
101+
const version = agentVersion.split('-')[0];
102+
core.setOutput('version', version);
103+
104+
92105
- name: Create multi arch manifests
93106
run: |
94-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.server_version }}-${{ github.ref_name }} \
107+
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ steps.extract_version.outputs.version }}-${{ github.ref_name }} \
95108
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
96109
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
97110
98-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.server_version }}-latest \
111+
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ steps.extract_version.outputs.version }}-latest \
99112
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
100113
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
101114

.github/workflows/ci.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ jobs:
1616
- name: Source checkout
1717
uses: actions/checkout@v4
1818

19+
- name: 'Setup yq'
20+
uses: dcarbone/[email protected]
21+
1922
- id: set-matrix
20-
run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT
23+
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
2124

2225
general_ci:
2326
permissions:
@@ -41,10 +44,19 @@ jobs:
4144
- name: Checkout repository
4245
uses: actions/checkout@v4
4346

47+
- name: Extract version number
48+
id: extract_version
49+
uses: actions/github-script@v7
50+
with:
51+
script: |
52+
const agentVersion = '${{ matrix.server_version }}';
53+
const version = agentVersion.split('-')[0];
54+
core.setOutput('version', version);
55+
4456
- name: Build image
4557
uses: docker/build-push-action@v6
4658
with:
47-
tags: 'ci/openvoxserver:${{ matrix.server_version }}'
59+
tags: 'ci/openvoxserver:${{ steps.extract_version.outputs.version }}'
4860
context: openvoxserver
4961
file: openvoxserver/Containerfile
5062
push: false

.github/workflows/security_scanning.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ jobs:
1818
- name: Source checkout
1919
uses: actions/checkout@v4
2020

21+
- name: 'Setup yq'
22+
uses: dcarbone/[email protected]
23+
2124
- id: set-matrix
22-
run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT
25+
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
2326

2427
scan_ci_container:
2528
name: 'Scan CI container'
@@ -35,10 +38,19 @@ jobs:
3538
- name: Checkout repository
3639
uses: actions/checkout@v4
3740

41+
- name: Extract version number
42+
id: extract_version
43+
uses: actions/github-script@v7
44+
with:
45+
script: |
46+
const agentVersion = '${{ matrix.server_version }}';
47+
const version = agentVersion.split('-')[0];
48+
core.setOutput('version', version);
49+
3850
- name: Build CI container
3951
uses: docker/build-push-action@v6
4052
with:
41-
tags: 'ci/openvoxserver:${{ matrix.server_version }}'
53+
tags: 'ci/openvoxserver:${{ steps.extract_version.outputs.version }}'
4254
context: openvoxserver
4355
file: openvoxserver/Containerfile
4456
push: false
@@ -53,7 +65,7 @@ jobs:
5365
uses: anchore/scan-action@v6
5466
id: scan
5567
with:
56-
image: 'ci/openvoxserver:${{ matrix.server_version }}'
68+
image: 'ci/openvoxserver:${{ steps.extract_version.outputs.version }}'
5769
fail-build: false
5870

5971
- name: Inspect action SARIF report

build_versions.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

build_versions.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
include:
3+
- release: 7
4+
# renovate: depName=openvox-server openVoxRelease=7
5+
server_version: "7.18.1-1+ubuntu24.04"
6+
# renovate: depName=openvoxdb openVoxRelease=7
7+
db_version: "7.21.1-1+ubuntu24.04"
8+
r10k_version: "4.1.0"
9+
rugged_version: "1.9.0"
10+
11+
- release: 8
12+
# renovate: depName=openvox-server openVoxRelease=8
13+
server_version: "8.8.0-1+ubuntu24.04"
14+
# renovate: depName=openvoxdb openVoxRelease=8
15+
db_version: "8.9.0-1+ubuntu24.04"
16+
r10k_version: "5.0.0"
17+
rugged_version: "1.9.0"

openvoxserver/Containerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ ARG vcs_ref
1616
ARG build_type
1717
ARG build_date
1818
ARG PACKAGES="git netbase openssh-client libssh2-1 dumb-init"
19-
ARG TARGETARCH
19+
ARG UBUNTU_VERSION=24.04
2020
ARG OPENVOX_RELEASE=8
21-
ARG OPENVOXSERVER_VERSION=8.8.0
22-
ARG OPENVOXDB_VERSION=8.9.0
21+
ARG OPENVOXSERVER_VERSION=8.8.0-1+ubuntu${UBUNTU_VERSION}
22+
ARG OPENVOXDB_VERSION=8.9.0-1+ubuntu${UBUNTU_VERSION}
2323
ARG OPENVOX_USER_UID=999
2424
ARG OPENVOX_USER_GID=999
25-
ARG UBUNTU_VERSION=24.04
25+
ARG OPENVOX_RELEASE_PACKAGE=openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb
2626

2727
LABEL org.label-schema.maintainer="Voxpupuli Team <[email protected]>" \
2828
org.label-schema.vendor="OpenVoxProject" \
@@ -81,8 +81,8 @@ COPY --from=builder /usr/local/bin/r10k /usr/local/bin/
8181

8282
ADD https://apt.overlookinfratech.com/openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb /
8383
RUN apt-get update && \
84-
apt-get install -y ca-certificates /openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb && \
85-
rm /openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb
84+
apt-get install -y ca-certificates /${OPENVOX_RELEASE_PACKAGE} && \
85+
rm /${OPENVOX_RELEASE_PACKAGE}
8686

8787
RUN groupadd -g ${OPENVOX_USER_GID} puppet && \
8888
useradd -m -u ${OPENVOX_USER_UID} -g puppet puppet && \
@@ -91,8 +91,8 @@ RUN groupadd -g ${OPENVOX_USER_GID} puppet && \
9191
apt-get upgrade -y && \
9292
apt-get install -y \
9393
$PACKAGES \
94-
openvoxdb-termini=${OPENVOXDB_VERSION}-* \
95-
openvox-server=${OPENVOXSERVER_VERSION}-* \
94+
openvoxdb-termini=${OPENVOXDB_VERSION} \
95+
openvox-server=${OPENVOXSERVER_VERSION} \
9696
&& \
9797
apt-get autoremove -y && \
9898
apt-get clean && \

renovate.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,14 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
44
"config:recommended"
5+
],
6+
"customManagers": [
7+
{
8+
"customType": "regex",
9+
"fileMatch": ["build_versions.yaml"],
10+
"matchStrings": ["#\\s*renovate:\\s*depName=(?<depName>.*?)\\s*openVoxRelease=(?<openVoxRelease>\\d+)\\s*\\n\\s*(?<key>\\w+_version):\\s*\"(?<currentValue>.*?)\""],
11+
"registryUrlTemplate": "https://apt.overlookinfratech.com?suite=ubuntu24.04&components=openvox{{openVoxRelease}}&binaryArch=amd64",
12+
"datasourceTemplate": "deb"
13+
}
514
]
615
}

0 commit comments

Comments
 (0)