forked from rpm-software-management/ci-dnf-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.f31
119 lines (98 loc) · 2.96 KB
/
Dockerfile.f31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Build
# -----
# $ podman build --build-arg TYPE=local -t dnf-bot/ci-dnf-stack:f31 -f Dockerfile.f31
#
#
# Run
# ---
# $ podman run -it dnf-bot/ci-dnf-stack:f31 behave -Ddnf_executable=dnf -t~xfail --junit --junit-directory=/opt/behave/junit/ [--wip --no-skipped]
#
#
# Build types
# -----------
# distro
# install distro packages
# copr
# install distro packages
# then upgrade to copr packages
# local
# install distro packages
# then upgrade to copr packages
# then install packages from local rpms/ folder
# install also additional tools for debugging in the container
FROM fedora:31
ENV LANG C
ARG TYPE=local
ARG OSVERSION=fedora__31
# disable deltas and weak deps
RUN set -x && \
echo -e "deltarpm=0" >> /etc/dnf/dnf.conf && \
echo -e "install_weak_deps=0" >> /etc/dnf/dnf.conf
# install fakeuname from dnf-nightly copr repo
RUN set -x && \
dnf -y install dnf-plugins-core; \
dnf -y copr enable rpmsoftwaremanagement/dnf-nightly; \
dnf -y install fakeuname;
# if not TYPE == copr nor local, disable nightly copr
RUN set -x && \
if [ ! "$TYPE" == "copr" -a ! "$TYPE" == "local" ]; then \
dnf -y copr disable rpmsoftwaremanagement/dnf-nightly; \
fi
# upgrade all packages to the latest available versions
RUN set -x && \
dnf -y --refresh upgrade
# install the test environment and additional packages
RUN set -x && \
dnf -y install \
# behave and test requirements
findutils \
libfaketime \
python3-behave \
python3-pexpect \
python3-pyftpdlib \
rpm-build \
rpm-sign \
# if TYPE == local, install debugging tools
$(if [ "$TYPE" == "local" ]; then \
echo \
less \
openssh-clients \
procps-ng \
psmisc \
screen \
strace \
tcpdump \
vim-enhanced \
vim-minimal \
wget \
; \
fi) \
# install dnf stack
createrepo_c \
dnf \
yum \
dnf-plugins-core \
dnf-utils \
# all plugins with the same version as dnf-utils
$(dnf repoquery dnf-utils --latest-limit=1 -q --qf="python*-dnf-plugin-*-%{version}-%{release}") \
libdnf \
microdnf
# install local RPMs if available
COPY ./rpms/ /opt/behave/rpms/
RUN rm /opt/behave/rpms/*-{devel,debuginfo,debugsource}*.rpm; \
if [ -n "$(find /opt/behave/rpms/ -maxdepth 1 -name '*.rpm' -print -quit)" ]; then \
dnf -y install /opt/behave/rpms/*.rpm --disableplugin=local; \
fi
# copy test suite
COPY ./dnf-behave-tests/ /opt/behave/
# set os userdata for behave
RUN echo -e "\
[behave.userdata]\n\
destructive=yes\n\
os=$OSVERSION" > /opt/behave/behave.ini
# build test repos from sources
RUN set -x && \
cd /opt/behave/fixtures/specs/ && \
./build.sh --force-rebuild
VOLUME ["/opt/behave/junit"]
WORKDIR /opt/behave