Skip to content

Commit

Permalink
fix!: debian builds to use correct context & dockerfile (#89)
Browse files Browse the repository at this point in the history
* fix!: debian builds to use correct context & dockerfile

* fix: add support for packages from bookworm

* feat: introduce exclude list and add refs broken on bookworm
  • Loading branch information
hertzg authored Aug 31, 2023
1 parent cf023df commit fc45f96
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions images/debian/build-context/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ LABEL maintainer="[email protected]" \
RUN apt-get update && apt-get install -y \
libusb-1.0-0 \
librtlsdr0 \
'^libsoapysdr0\.[6-7]$' \
libssl1.1 \
'^soapysdr0\.[6-7]-module-all$' \
'^libsoapysdr0\.[6-8]$' \
'^libssl(1\.1|3)$' \
'^soapysdr0\.[6-8]-module-all$' \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /root
Expand Down
21 changes: 18 additions & 3 deletions src/debian.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const fetchLastDebianCycleCodenames = async () => {
const DEBIAN_VERSIONS = await fetchLastDebianCycleCodenames();
const DEBIAN_LATEST_VERSION = DEBIAN_VERSIONS[0];

const BROKEN_RTLVERSIONS_FOR_DEBIAN_CYCLES = new Map([
["bookworm", ["19.08", "18.12"]],
]);

const generateTags = (baseVersion: string, gitRef: string) => {
const tags = [
`${gitRef}-debian-${baseVersion}`,
Expand Down Expand Up @@ -56,7 +60,18 @@ export const createDebianBuildTasks = (
})
);

const tasks: BuildTask[] = variants.map(
const tasks: BuildTask[] = variants.filter(
({ gitRef, debianVersion }) => {
if (BROKEN_RTLVERSIONS_FOR_DEBIAN_CYCLES.has(debianVersion)) {
const brokenRefs = BROKEN_RTLVERSIONS_FOR_DEBIAN_CYCLES.get(
debianVersion,
)!;
return !brokenRefs.includes(gitRef);
}

return true;
},
).map(
({ gitRef, debianVersion, isLatestGitRef, isLatestBase }) => {
const tags = generateTags(debianVersion, gitRef);

Expand All @@ -75,8 +90,8 @@ export const createDebianBuildTasks = (
return {
name: `debian-${debianVersion}-${gitRef}`,
gitRef: gitRef,
context: "./images/alpine/build-context",
file: "./images/alpine/build-context/Dockerfile",
context: "./images/debian/build-context",
file: "./images/debian/build-context/Dockerfile",
tags,
buildArgs: {
rtl433GitVersion: gitRef,
Expand Down

0 comments on commit fc45f96

Please sign in to comment.