Fix handling of DEB package naming in CI. (#13076)
* Fix handling of DEB package naming in CI. * Bump repoconfig package versions. To ensure naming consistency. * Fix repoconfig package renaming.
Austin S. Hemmelgarn committed
Jun 6, 2022 at 12:31 UTC
1e9d602ad5e2467eaea7eb335240c46fe829d817
4 files changed
+27
-2
.github/scripts/pkg-test.sh
+1
-1
@@ -7,7 +7,7 @@ install_debian_like() {
7
apt-get update
8
9
# Install Netdata
10
- apt-get install -y /netdata/artifacts/netdata_"${VERSION}"_*.deb || exit 1
10
+ apt-get install -y /netdata/artifacts/netdata_"${VERSION}"*_*.deb || exit 1
11
12
# Install testing tools
13
apt-get install -y --no-install-recommends curl netcat jq || exit 1
packaging/repoconfig/build-deb.sh
+17
@@ -1,5 +1,9 @@
1
#!/bin/sh
2
3
+# Extract distro info from /etc/os-release
4
+DISTVERS="$(awk -F'"' '/VERSION_ID=/ {print $2}' /etc/os-release)"
5
+DISTNAME="$(awk -F'=' '/^ID=/ {print $2}' /etc/os-release)"
6
+
7
# Needed because dpkg is stupid and tries to configure things interactively if it sees a terminal.
8
export DEBIAN_FRONTEND=noninteractive
9
@@ -21,6 +25,19 @@ else
25
dpkg-buildpackage -b -us -uc || exit 1
26
fi
27
28
+# Embed distro info in package name.
29
+# This is required to make the repo actually standards compliant wthout packageclouds hacks.
30
+distid="${DISTNAME}${DISTVERS}"
31
+for pkg in /usr/src/*.deb; do
32
+ pkgname="$(basename "${pkg}" .deb)"
33
+ name="$(echo "${pkgname}" | cut -f 1 -d '_')"
34
+ version="$(echo "${pkgname}" | cut -f 2 -d '_')"
35
+ arch="$(echo "${pkgname}" | cut -f 3 -d '_')"
36
+
37
+ newname="$(dirname "${pkg}")/${name}_${version}+${distid}_${arch}.deb"
38
+ mv "${pkg}" "${newname}"
39
+done
40
+
41
# Copy the built packages to /netdata/artifacts (which may be bind-mounted)
42
# Also ensure /netdata/artifacts exists and create it if it doesn't
43
[ -d /netdata/artifacts ] || mkdir -p /netdata/artifacts
packaging/repoconfig/debian/changelog
+6
@@ -1,3 +1,9 @@
1
+netdata-repo (1-2) unstable; urgency=medium
2
+
3
+ * Fixed package file naming for repo layout compliance
4
+
5
+ -- Netdata Builder <bot@netdata.cloud> Mon, 6 Jun 2022 09:30:00 -0500
6
+
7
netdata-repo (1-1) unstable; urgency=medium
8
9
* Initial Release
packaging/repoconfig/netdata-repo.spec
+3
-1
@@ -2,7 +2,7 @@
2
3
Name: netdata-repo
4
Version: 1
5
-Release: 1
5
+Release: 2
6
Summary: Netdata stable repositories configuration.
7
8
Group: System Environment/Base
@@ -96,5 +96,7 @@ This package contains the official Netdata package repository configuration for
96
%endif
97
98
%changelog
99
+* Mon Jun 6 2022 Austin Hemmelgarn <austin@netdata.cloud> 1-2
100
+- Bump release to keep in sync with DEB package.
101
* Mon Jun 14 2021 Austin Hemmelgarn <austin@netdata.cloud> 1-1
102
- Initial revision