Skip to content

Commit 8f69970

Browse files
imker25Tobias Zellner
and
Tobias Zellner
authored
feat: Create packages for 2024 autumn versions (MR #144)
Add package for Ubuntu 24.10 - #141 Add package for Fedora 41 - #142 Remove package for Ubuntu 23.10 - #138 Remove package for Fedora 39 --------- Co-authored-by: Tobias Zellner <[email protected]>
1 parent 6800775 commit 8f69970

File tree

7 files changed

+160
-17
lines changed

7 files changed

+160
-17
lines changed

.github/workflows/release-jobs.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,15 @@ jobs:
9494
asset_path: ./bin/deb-packages/binary/samba-exporter_${{ env.SAMBA_EXPORTER_RELEASE_TAG }}~ppa1~ubuntu24.04_amd64.deb
9595
asset_name: samba-exporter_${{ env.SAMBA_EXPORTER_RELEASE_TAG }}~ppa1~ubuntu24.04_amd64.deb
9696
asset_content_type: application/zip
97-
# This section will be used for Ubuntu 24.10 packages
98-
# - name: Upload Release Asset for Ubuntu 23.10
99-
# uses: actions/upload-release-asset@v1
100-
# env:
101-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102-
# with:
103-
# upload_url: ${{ env.SAMBA_EXPORTER_UPLOAD_URL }}
104-
# asset_path: ./bin/deb-packages/binary/samba-exporter_${{ env.SAMBA_EXPORTER_RELEASE_TAG }}~ppa1~ubuntu23.10_amd64.deb
105-
# asset_name: samba-exporter_${{ env.SAMBA_EXPORTER_RELEASE_TAG }}~ppa1~ubuntu23.10_amd64.deb
106-
# asset_content_type: application/zip
97+
- name: Upload Release Asset for Ubuntu 24.10
98+
uses: actions/upload-release-asset@v1
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
with:
102+
upload_url: ${{ env.SAMBA_EXPORTER_UPLOAD_URL }}
103+
asset_path: ./bin/deb-packages/binary/samba-exporter_${{ env.SAMBA_EXPORTER_RELEASE_TAG }}~ppa1~ubuntu24.10_amd64.deb
104+
asset_name: samba-exporter_${{ env.SAMBA_EXPORTER_RELEASE_TAG }}~ppa1~ubuntu24.10_amd64.deb
105+
asset_content_type: application/zip
107106
- name: Upload Release Asset for Debian 12
108107
uses: actions/upload-release-asset@v1
109108
env:
@@ -212,14 +211,14 @@ jobs:
212211
asset_path: bin/rpm-packages/Fedora-35/samba-exporter-${{ env.SAMBA_EXPORTER_RELEASE_TAG }}-1.fc35.x86_64.rpm
213212
asset_name: samba-exporter-${{ env.SAMBA_EXPORTER_RELEASE_TAG }}-1.fc35.x86_64.rpm
214213
asset_content_type: application/zip
215-
- name: Upload Release Asset for Fedora 39
214+
- name: Upload Release Asset for Fedora 41
216215
uses: actions/upload-release-asset@v1
217216
env:
218217
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219218
with:
220219
upload_url: ${{ env.SAMBA_EXPORTER_UPLOAD_URL }}
221-
asset_path: bin/rpm-packages/Fedora-39/samba-exporter-${{ env.SAMBA_EXPORTER_RELEASE_TAG }}-1.fc39.x86_64.rpm
222-
asset_name: samba-exporter-${{ env.SAMBA_EXPORTER_RELEASE_TAG }}-1.fc39.x86_64.rpm
220+
asset_path: bin/rpm-packages/Fedora-41/samba-exporter-${{ env.SAMBA_EXPORTER_RELEASE_TAG }}-1.fc41.x86_64.rpm
221+
asset_name: samba-exporter-${{ env.SAMBA_EXPORTER_RELEASE_TAG }}-1.fc41.x86_64.rpm
223222
asset_content_type: application/zip
224223
- name: Upload Release Asset for Fedora 40
225224
uses: actions/upload-release-asset@v1
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# ######################################################################################
2+
# Copyright 2021 by [email protected]. All
3+
# rights reserved. Use of this source code is governed
4+
# by a BSD-style license that can be found in the
5+
# LICENSE file.
6+
# ######################################################################################
7+
# Container image used by ./../PublishLaunchpadInDocker.sh to transfer the sources to the launchpad-ppa
8+
# The actual transformation is done by ./PublishLaunchpad.sh when this container get started
9+
# ######################################################################################
10+
11+
# Use the packages target version (noble = ubuntu 24.04) as base image
12+
FROM ubuntu:oracular
13+
14+
# Setup the system and install needed packages
15+
ENV DEBIAN_FRONTEND="noninteractive"
16+
ENV TZ="Europe/London"
17+
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y wget \
18+
curl \
19+
libc6 \
20+
golang-1.23 \
21+
gzip \
22+
ronn\
23+
debhelper \
24+
golang-any \
25+
golang-github-go-kit-kit-dev \
26+
golang-github-prometheus-client-golang-dev \
27+
golang-github-prometheus-common-dev \
28+
golang-gopkg-alecthomas-kingpin.v2-dev \
29+
golang-github-shirou-gopsutil-dev \
30+
dh-golang \
31+
debhelper \
32+
dh-make \
33+
lintian \
34+
git-buildpackage \
35+
git \
36+
openssh-client \
37+
procps \
38+
gpg
39+
40+
# Copy the script
41+
COPY PublishLaunchpad.sh /PublishLaunchpad.sh
42+
RUN chmod 777 /PublishLaunchpad.sh
43+
44+
ARG USER
45+
ARG UID
46+
ARG GID
47+
48+
RUN mkdir -p /home/${USER} &&\
49+
chmod 770 /home/${USER} && \
50+
chown ${UID}:${GID} /home/${USER}
51+
52+
RUN addgroup --gid ${GID} ${USER} &&\
53+
adduser --system --quiet --home /home/${USER} --gid ${GID} --uid ${UID} --gecos "builder" ${USER} || true
54+
55+
RUN id ${UID} && ls -l /home/

build/LaunchpadPublish/PublishLaunchpad.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,18 @@ if [ "$distVersionNumber" == "24.04" ] && [ "$distribution" == "Ubuntu" ]; then
292292
sed -i "s/golang-1.16,/golang-1.22,/g" $WORK_DIR/install/debian/control
293293
find . -name "*.go" -exec sed -i "s/github.com\\/shirou\\/gopsutil\\/v3\\/process/github.com\\/shirou\\/gopsutil\\/process/g" {} \;
294294
else
295-
echo "Not running on lunar 23.10 (mantic)"
295+
echo "Not running on lunar 24.04 (noble)"
296+
fi
297+
298+
if [ "$distVersionNumber" == "24.10" ] && [ "$distribution" == "Ubuntu" ]; then
299+
sed -i "s/focal;/oracular;/g" $WORK_DIR/install/debian/changelog
300+
sed -i "s/ubuntu20.04/ubuntu24.10/g" $WORK_DIR/install/debian/changelog
301+
sed -i "s/jammy;/oracular;/g" $WORK_DIR/install/debian/changelog
302+
sed -i "s/ubuntu22.04/ubuntu24.10/g" $WORK_DIR/install/debian/changelog
303+
sed -i "s/golang-1.16,/golang-1.23,/g" $WORK_DIR/install/debian/control
304+
find . -name "*.go" -exec sed -i "s/github.com\\/shirou\\/gopsutil\\/v3\\/process/github.com\\/shirou\\/gopsutil\\/process/g" {} \;
305+
else
306+
echo "Not running on lunar 24.10 (oracular)"
296307
fi
297308

298309
if [ "$distVersionNumber" == "12" ] && [ "$distribution" == "Debian" ]; then

build/PublishLaunchpadInDocker.sh

+17
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ function buildAndRunDocker() {
5555
if [ "${distVersion}" == "noble" ] && [ "$(id -u)" == "1000" ]; then
5656
userName="ubuntu"
5757
fi
58+
if [ "${distVersion}" == "oracular" ] && [ "$(id -u)" == "1000" ]; then
59+
userName="ubuntu"
60+
fi
5861
if [ "$dryRun" == "false" ]; then
5962
docker run --env LAUNCHPAD_SSH_ID_PUB="$LAUNCHPAD_SSH_ID_PUB" \
6063
--env LAUNCHPAD_SSH_ID_PRV="$LAUNCHPAD_SSH_ID_PRV" \
@@ -217,6 +220,20 @@ echo "Delete the container image when done"
217220
docker rmi -f $(docker images --filter=reference="launchapd-publish*" -q)
218221
docker builder prune --all --force
219222

223+
if [ "$dockerError" == "false" ];then
224+
echo "Publish tag $tag on launchpad within a docker cotainer for oracular"
225+
echo "# ###################################################################"
226+
buildAndRunDocker "oracular"
227+
if [ "$?" != "0" ]; then
228+
dockerError="true"
229+
echo "Error while publish package for oracular"
230+
fi
231+
fi
232+
echo "# ###################################################################"
233+
echo "Delete the container image when done"
234+
docker rmi -f $(docker images --filter=reference="launchapd-publish*" -q)
235+
docker builder prune --all --force
236+
220237
# Remember new ubuntu docker containers need user rewrite. See buildAndRunDocker function first half
221238

222239

build/PublishRpmInDocker.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ docker builder prune --all --force
199199

200200

201201
if [ "$dockerError" == "false" ];then
202-
echo "Publish tag $tag on corp within a docker cotainer for fedora 39"
202+
echo "Publish tag $tag on corp within a docker cotainer for fedora 41"
203203
echo "# ###################################################################"
204-
buildAndRunDocker "fedora39"
204+
buildAndRunDocker "fedora41"
205205
if [ "$?" != "0" ]; then
206206
dockerError="true"
207-
echo "Error while publish for fedora 39"
207+
echo "Error while publish for fedora 41"
208208
fi
209209
fi
210210
echo "# ###################################################################"

build/rpm-publish/Dockerfile.fedora41

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# ######################################################################################
2+
# Copyright 2021 by [email protected]. All
3+
# rights reserved. Use of this source code is governed
4+
# by a BSD-style license that can be found in the
5+
# LICENSE file.
6+
# ######################################################################################
7+
# Container image used by ./../PublishRpmInDocker.sh to transfer the sources to the launchpad-ppa
8+
# The actual transformation is done by ./RpmPublish.sh when this container get started
9+
# ######################################################################################
10+
11+
FROM fedora:41
12+
13+
RUN dnf -y update && \
14+
dnf install -y 'dnf-command(builddep)' \
15+
redhat-lsb \
16+
rubygem-ronn-ng \
17+
rpmdevtools \
18+
rpmlint \
19+
rpm-build \
20+
rpm-sign \
21+
gzip \
22+
curl \
23+
man-db \
24+
binutils \
25+
wget \
26+
git \
27+
go-rpm-macros \
28+
openssh-clients \
29+
copr-cli \
30+
procps-ng \
31+
gnupg && \
32+
dnf clean all
33+
34+
COPY samba-exporter.from_source.spec /samba-exporter.from_source.spec
35+
36+
RUN dnf builddep /samba-exporter.from_source.spec -y && \
37+
dnf clean all
38+
39+
ARG USER
40+
ARG UID
41+
ARG GID
42+
43+
# Add publish script
44+
COPY RpmPublish.sh /RpmPublish.sh
45+
RUN chmod 777 /RpmPublish.sh
46+
47+
RUN mkdir -p /home/${USER} &&\
48+
chmod 770 /home/${USER} && \
49+
chown ${UID}:${GID} /home/${USER} && \
50+
chmod 777 /var/lib/rpm/
51+

build/rpm-publish/RpmPublish.sh

+10
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,16 @@ else
316316
echo "Not running on Fedora 40"
317317
fi
318318

319+
if [ "$distribution" == "Fedora" ] && [ "$distVersionNumber" == "41" ]; then
320+
echo "Do modifications for 'Fedora 41'"
321+
sed -i "s/Release: 1/Release: 1.fc41/g" ~/rpmbuild/SPECS/samba-exporter.spec
322+
buildSystem="rpm"
323+
changeroots="--chroot fedora-${distVersionNumber}-x86_64"
324+
coprUpload="true"
325+
else
326+
echo "Not running on Fedora 41"
327+
fi
328+
319329
echo "# ###################################################################"
320330
echo "~/rpmbuild/SPECS/samba-exporter.spec after modification"
321331
echo "# ###################################################################"

0 commit comments

Comments
 (0)