Skip to content

Commit bfbba77

Browse files
authored
Merge pull request #101 from cobbler/update-packaging
Update packaging
2 parents 53c1039 + 186fe16 commit bfbba77

File tree

15 files changed

+137
-125
lines changed

15 files changed

+137
-125
lines changed

.github/workflows/packaging.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
tags:
8-
- 'v*'
8+
- "v*"
99
pull_request:
1010
branches:
1111
- main
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Build a RockyLinux 8 Package
18+
- name: Build a RockyLinux 9 Package
1919
shell: 'script -q -e -c "bash {0}"'
2020
run: |
21-
./docker/rpms/build-and-install-rpms.sh rl8 docker/rpms/RockyLinux8/RockyLinux8.dockerfile
21+
./docker/rpms/build-and-install-rpms.sh rl9 docker/rpms/RockyLinux9/RockyLinux9.dockerfile
2222
- name: Archive RPMs
2323
uses: actions/upload-artifact@v4
2424
with:
@@ -45,10 +45,10 @@ jobs:
4545
- uses: actions/checkout@v4
4646
- name: Install System dependencies
4747
run: sudo apt-get install -y rename
48-
- name: Build a openSUSE Leap 15.3 Package
48+
- name: Build a openSUSE Leap 15 Package
4949
shell: 'script -q -e -c "bash {0}"'
5050
run: |
51-
./docker/rpms/build-and-install-rpms.sh opensuse-leap docker/rpms/openSUSE_Leap_15.3/openSUSE_Leap_15.3.dockerfile
51+
./docker/rpms/build-and-install-rpms.sh opensuse-leap docker/rpms/openSUSE_Leap_15/openSUSE_Leap_15.dockerfile
5252
- name: Rename RPM
5353
run: |
5454
file-rename -v -d -e 's/koan-(\d+\.\d+\.\d+)-1\.(\w+)\.rpm/koan-$1-1.leap.$2.rpm/' rpm-build/*.rpm
@@ -111,6 +111,7 @@ jobs:
111111
python3-pip
112112
python3-libvirt-python
113113
python3-Sphinx
114+
python3-sphinx_rtd_theme
114115
python3-netifaces
115116
tree
116117
- uses: actions/checkout@v4
@@ -132,14 +133,15 @@ jobs:
132133
create-release:
133134
name: Build the release and create a GitHub release
134135
runs-on: ubuntu-latest
135-
needs: [
136-
build-rockylinux-rpms,
137-
build-fedora-rpms,
138-
build-opensuse-leap-rpms,
139-
build-opensuse-tumbleweed-rpms,
140-
build-debian-debs,
141-
build-wheel
142-
]
136+
needs:
137+
[
138+
build-rockylinux-rpms,
139+
build-fedora-rpms,
140+
build-opensuse-leap-rpms,
141+
build-opensuse-tumbleweed-rpms,
142+
build-debian-debs,
143+
build-wheel,
144+
]
143145
steps:
144146
- uses: actions/checkout@v4
145147
- uses: actions/download-artifact@v4

.github/workflows/testing.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
container: registry.opensuse.org/opensuse/tumbleweed:latest
1515
steps:
16-
- name: Install pre reqs
17-
run: zypper -n in git tar
1816
- uses: actions/checkout@v4
1917
- name: Install package deps
20-
run: zypper -n in --no-recommends python3-devel python3-wheel python3-pip python3-libvirt-python python3-codecov gcc make
18+
run: zypper -n in --no-recommends git tar python3 python3-devel python3-wheel python3-pip python3-libvirt-python gcc make
2119
- name: Install dependencies
2220
run: pip3 install --break-system-packages .[lint,test]
2321
- name: Run tests
2422
run: pytest --cov=./koan
25-
- name: Upload report to codecov
26-
run: codecov

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ TOP_DIR:=$(shell pwd)
22
DESTDIR=/
33
PYFLAKES = $(shell { command -v pyflakes-3 || command -v pyflakes3 || command -v pyflakes; } 2> /dev/null)
44
BLACK := $(shell { command -v black; } 2> /dev/null)
5-
5+
PYTHON=/usr/bin/python3
66

77
all: clean build
88

@@ -52,11 +52,11 @@ authors:
5252

5353
sdist: authors
5454
@echo "creating: sdist"
55-
@python3 setup.py sdist
55+
${PYTHON} -m build --sdist
5656

5757
bdist: authors
5858
@echo "creating: bdist"
59-
@python3 setup.py sdist bdist_wheel
59+
${PYTHON} -m build
6060

6161
release: clean qa authors sdist bdist doc
6262
@echo "creating: release artifacts"
@@ -68,19 +68,16 @@ nosetests:
6868
PYTHONPATH=./koan/ nosetests -v -w tests/cli/ 2>&1 | tee test.log
6969

7070
build:
71-
python3 setup.py build -f
71+
${PYTHON} -m pip wheel -f .
7272

7373
# Debian/Ubuntu requires an additional parameter in setup.py
7474
install: build
7575
if [ -e /etc/debian_version ]; then \
76-
python3 setup.py install --root $(DESTDIR) -f --install-layout=deb; \
76+
${PYTHON} -m build --root $(DESTDIR) -f --install-layout=deb; \
7777
else \
78-
python3 setup.py install --root $(DESTDIR) -f; \
78+
${PYTHON} -m build --root $(DESTDIR) -f; \
7979
fi
8080

81-
savestate:
82-
python3 setup.py -v savestate --root $(DESTDIR); \
83-
8481
rpms: release
8582
mkdir -p rpm-build
8683
cp dist/*.gz rpm-build/

docker/debs/build-and-install-debs.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
set -euo pipefail
55

6-
if [ "$1" == "--with-tests" ]
7-
then
6+
if [ "$1" == "--with-tests" ]; then
87
RUN_TESTS=true
98
shift
109
else
@@ -36,8 +35,7 @@ docker exec -it koan bash -c 'dpkg -i deb-build/DEBS/all/koan*.deb'
3635
#echo "==> Wait 5 sec. and show Koan version ..."
3736
#docker exec -it koan bash -c 'koan'
3837

39-
if $RUN_TESTS
40-
then
38+
if $RUN_TESTS; then
4139
# Almost all of these requirement are already satisfied in the Dockerfiles!
4240
echo "==> Running tests ..."
4341
docker exec -it koan bash -c 'pip3 install coverage distro setuptools sphinx netaddr distro'
@@ -50,4 +48,4 @@ echo "==> Stop Koan container ..."
5048
docker stop koan
5149
echo "==> Delete Koan container ..."
5250
docker rm koan
53-
rm -rf ./tmp
51+
rm -rf ./tmp

docker/debs/debian/Debian10.dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
FROM debian:11
44

5-
ENV DEBIAN_FRONTEND noninteractive
5+
ENV DEBIAN_FRONTEND=noninteractive
66

77
# TERM=screen is fairly neutral and works with xterm for example, for others
88
# you might need to pass -e TERM=<terminal>, like rxvt-unicode.
9-
ENV TERM screen
10-
ENV OSCODENAME bullseye
9+
ENV TERM=screen
10+
ENV OSCODENAME=bullseye
1111

1212
# Add repo for debbuild and install all packages required
1313
# hadolint ignore=DL3008,DL3015,DL4006
@@ -21,6 +21,7 @@ RUN apt-get update -qq && \
2121
debbuild-macros \
2222
wget \
2323
pycodestyle \
24+
python3-dev \
2425
python3-pyflakes \
2526
python3-coverage \
2627
python3-wheel \

docker/rpms/Fedora/Fedora.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN dnf install -y \
1010
make \
1111
rpm-build \
1212
virt-install \
13+
fdupes \
1314
python3-devel \
1415
python3-wheel \
1516
python3-build \

docker/rpms/RockyLinux8/RockyLinux8.dockerfile renamed to docker/rpms/RockyLinux9/RockyLinux9.dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# vim: ft=dockerfile
22

3-
FROM rockylinux:8
3+
FROM rockylinux:9
44

55
RUN dnf makecache && \
66
dnf install -y epel-release dnf-utils && \
7-
dnf config-manager --set-enabled powertools && \
7+
dnf config-manager --set-enabled crb && \
8+
dnf config-manager --set-enabled highavailability && \
89
dnf makecache
910

1011
# overlay2 bug with yum/dnf
@@ -22,10 +23,13 @@ RUN touch /var/lib/rpm/* && \
2223
rpm-build \
2324
epel-rpm-macros \
2425
virt-install \
26+
fdupes \
2527
python3-devel \
28+
python3-build \
2629
python3-setuptools \
2730
python3-wheel \
2831
python3-sphinx \
32+
python3-sphinx_rtd_theme \
2933
python3-distro \
3034
python3-netifaces \
3135
python3-libvirt

docker/rpms/build-and-install-rpms.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
set -eo pipefail
55

6-
if [ "$1" == "--with-tests" ]
7-
then
6+
if [ "$1" == "--with-tests" ]; then
87
RUN_TESTS=true
98
shift
109
else
@@ -23,7 +22,11 @@ docker build -t "$IMAGE" -f "$DOCKERFILE" .
2322
# Build RPMs
2423
echo "==> Build RPMs ..."
2524
mkdir -p rpm-build
26-
docker run -ti -v "$PWD/rpm-build:/usr/src/koan/rpm-build" "$IMAGE"
25+
if [ "$TAG" == "opensuse-leap" ]; then
26+
docker run -ti -v "$PWD/rpm-build:/usr/src/koan/rpm-build" "$IMAGE" make PYTHON=/usr/bin/python3.11 rpms
27+
else
28+
docker run -ti -v "$PWD/rpm-build:/usr/src/koan/rpm-build" "$IMAGE"
29+
fi
2730

2831
# Launch container and install koan
2932
echo "==> Start container ..."
@@ -36,8 +39,7 @@ docker exec -it koan bash -c 'rpm -Uvh rpm-build/koan-*.noarch.rpm'
3639
#echo "==> Show Koan version ..."
3740
#docker exec -it koan bash -c 'koan version'
3841

39-
if $RUN_TESTS
40-
then
42+
if $RUN_TESTS; then
4143
echo "==> Running tests ..."
4244
docker exec -it koan bash -c 'pip3 install coverage distro setuptools sphinx requests netifaces'
4345
docker exec -it koan bash -c 'pip3 install pyflakes pycodestyle pytest pytest-cov codecov'

docker/rpms/install-rpms.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# Utility script to run Docker container without building the RPMs,
33
# just install them. So make sure they are in rpm-build dir!
44

5-
if [ "$1" == "--with-tests" ]
6-
then
5+
if [ "$1" == "--with-tests" ]; then
76
RUN_TESTS=true
87
shift
98
else
@@ -23,8 +22,7 @@ docker exec -it koan bash -c 'rpm -Uvh rpm-build/koan-*.noarch.rpm'
2322
#echo "==> Show Koan version ..."
2423
#docker exec -it koan bash -c 'koan version'
2524

26-
if $RUN_TESTS
27-
then
25+
if $RUN_TESTS; then
2826
echo "==> Running tests ..."
2927
docker exec -it koan bash -c 'pip3 install coverage distro setuptools sphinx requests netifaces'
3028
docker exec -it koan bash -c 'pip3 install pyflakes pycodestyle pytest pytest-cov codecov'

docker/rpms/openSUSE_Leap_15.3/openSUSE_Leap_15.3.dockerfile

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

0 commit comments

Comments
 (0)