Skip to content

Commit 14b098c

Browse files
authored
enh(ci): keep packages cache during plugins testing (centreon#5321)
1 parent 0135299 commit 14b098c

5 files changed

Lines changed: 21 additions & 9 deletions

File tree

.github/docker/testing/Dockerfile.testing-plugins-bookworm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ EOF
1818
ENV LANG en_US.utf8
1919

2020
RUN bash -e <<EOF
21+
22+
# Avoid apt to clean packages cache directory
23+
rm -f /etc/apt/apt.conf.d/docker-clean
24+
2125
apt-get update
2226
# Install Robotframework
2327
apt-get install -y python3-dev python3-pip

.github/docker/testing/Dockerfile.testing-plugins-bullseye

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ EOF
1818
ENV LANG en_US.utf8
1919

2020
RUN bash -e <<EOF
21+
22+
# Avoid apt to clean packages cache directory
23+
rm -f /etc/apt/apt.conf.d/docker-clean
24+
2125
apt-get update
2226
# Install Robotframework
2327
apt-get install -y python3 python3-dev python3-pip

.github/docker/testing/Dockerfile.testing-plugins-jammy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ EOF
1818
ENV LANG en_US.utf8
1919

2020
RUN bash -e <<EOF
21+
22+
# Avoid apt to clean packages cache directory
23+
rm -f /etc/apt/apt.conf.d/docker-clean
24+
2125
apt-get update
2226
# Install Robotframework
2327
apt-get install -y python3 python3-dev python3-pip

.github/scripts/test-all-plugins.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def install_plugin(plugin, archi):
7474
"apt-get install -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' -y ./" + plugin.lower() + "*.deb",
7575
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
7676
elif archi == "rpm":
77-
outfile.write("dnf install -y ./" + plugin + "*.rpm\n")
78-
output_status = (subprocess.run("dnf install -y ./" + plugin + "*.rpm", shell=True, check=False,
77+
outfile.write("dnf install --setopt=keepcache=True -y ./" + plugin + "*.rpm\n")
78+
output_status = (subprocess.run("dnf install --setopt=keepcache=True -y ./" + plugin + "*.rpm", shell=True, check=False,
7979
stderr=subprocess.STDOUT, stdout=outfile)).returncode
8080
else:
8181
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
@@ -95,8 +95,8 @@ def remove_plugin(plugin, archi):
9595
# 'autoremove', contrary to 'remove' all dependancy while removing the original package.
9696

9797
elif archi == "rpm":
98-
outfile.write("dnf remove -y " + plugin + "\n")
99-
output_status = (subprocess.run("dnf remove -y " + plugin, shell=True, check=False,
98+
outfile.write("dnf remove --setopt=keepcache=True -y " + plugin + "\n")
99+
output_status = (subprocess.run("dnf remove --setopt=keepcache=True -y " + plugin, shell=True, check=False,
100100
stderr=subprocess.STDOUT, stdout=outfile)).returncode
101101
else:
102102
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")

.github/workflows/docker-builder-testing-plugins.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
include:
26-
- runner: ubuntu-22.04
26+
- runner: ubuntu-24.04
2727
dockerfile: alma8
2828
image: alma8
29-
- runner: ubuntu-22.04
29+
- runner: ubuntu-24.04
3030
dockerfile: alma9
3131
image: alma9
32-
- runner: ubuntu-22.04
32+
- runner: ubuntu-24.04
3333
dockerfile: bullseye
3434
image: bullseye
3535
- runner: ["self-hosted", "collect-arm64"]
3636
dockerfile: bullseye
3737
image: bullseye-arm64
38-
- runner: ubuntu-22.04
38+
- runner: ubuntu-24.04
3939
dockerfile: bookworm
4040
image: bookworm
41-
- runner: ubuntu-22.04
41+
- runner: ubuntu-24.04
4242
dockerfile: jammy
4343
image: jammy
4444

0 commit comments

Comments
 (0)