diff --git a/ci/Dockerfile.fedora b/ci/Dockerfile.fedora index 8fe6b129..09dc7475 100644 --- a/ci/Dockerfile.fedora +++ b/ci/Dockerfile.fedora @@ -1,15 +1,7 @@ FROM fedora:34 -RUN dnf -y upgrade -RUN dnf -y install gcc make cmake libcurl-devel rpm-devel rpm-build \ - libsolv-devel popt-devel sed createrepo_c glib2-devel expat \ - findutils python3-pytest python3-requests python3-urllib3 \ - python3-pyOpenSSL python3 python3-devel valgrind gpgme-devel \ - expat-devel openssl-devel sqlite-devel rpm-sign which python3-pip \ - shadow-utils sudo e2fsprogs util-linux - -RUN pip3 install flake8 - -RUN mkdir -p /var/lib/tdnf +COPY ci/prep.sh /prep.sh +RUN chmod +x /prep.sh +RUN /prep.sh CMD ["/bin/bash"] diff --git a/ci/Dockerfile.photon b/ci/Dockerfile.photon index b93955e2..d7919329 100644 --- a/ci/Dockerfile.photon +++ b/ci/Dockerfile.photon @@ -1,19 +1,7 @@ FROM photon:latest -RUN tdnf update -y -RUN tdnf remove -y toybox -RUN tdnf install -y --enablerepo=photon-debuginfo \ - build-essential cmake curl-devel rpm-build \ - libsolv-devel popt-devel sed createrepo_c glib expat-libs \ - findutils python3 python3-pip python3-setuptools \ - python3-devel valgrind gpgme-devel glibc-debuginfo \ - expat-devel openssl-devel zlib-devel sqlite-devel \ - python3-requests python3-urllib3 python3-pyOpenSSL \ - sudo shadow which e2fsprogs util-linux - -# this can to be removed once latest pytest gets published in photon -RUN pip3 install pytest flake8 - -RUN mkdir -p /var/lib/tdnf +COPY ci/prep.sh /prep.sh +RUN chmod +x /prep.sh +RUN /prep.sh CMD ["/bin/bash"] diff --git a/ci/prep.sh b/ci/prep.sh new file mode 100644 index 00000000..cf57f074 --- /dev/null +++ b/ci/prep.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -ex + +rel_file="/etc/os-release" + +common_pkgs=( + cmake + createrepo_c + e2fsprogs + expat-devel + findutils + gpgme-devel + libsolv-devel + openssl-devel + popt-devel + python3-devel + python3-pip + python3-pyOpenSSL + python3-requests + python3-urllib3 + rpm-build + sed + sqlite-devel + sudo + util-linux + valgrind + which +) + +if grep -qw "Fedora" ${rel_file}; then + fedora_packages=( + ${common_pkgs[@]} + gcc + glib2-devel + libcurl-devel + make + python3-pytest + python3-flake8 + rpm-devel + rpm-sign + shadow-utils + ) + dnf -y upgrade --refresh + dnf -y install ${fedora_packages[@]} +elif grep -qw "Photon" ${rel_file}; then + photon_packages=( + ${common_pkgs[@]} + build-essential + curl-devel + glib + glibc-debuginfo + shadow + zlib-devel + ) + tdnf -y upgrade --refresh + tdnf remove -y toybox + tdnf -y install --enablerepo=photon-debuginfo ${photon_packages[@]} + pip3 install pytest flake8 +fi + +mkdir -p /var/lib/tdnf