forked from rpm-software-management/ci-dnf-stack
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.f29
113 lines (94 loc) · 2.87 KB
/
Dockerfile.f29
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
# Build
# -----
# $ podman build --build-arg TYPE=local -t dnf-bot/ci-dnf-stack:f29 -f Dockerfile.f29
#
#
# Run
# ---
# $ podman run -it dnf-bot/ci-dnf-stack:f29 behave -Ddnf_executable=dnf --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:29
ENV LANG C
ARG TYPE=local
ARG OSVERSION=fedora__29
# disable deltas and weak deps
# enable fedora-updates-testing repo
RUN set -x && \
echo -e "deltarpm=0" >> /etc/dnf/dnf.conf && \
echo -e "install_weak_deps=0" >> /etc/dnf/dnf.conf && \
sed -i '0,/enabled=.*$/s//enabled=1/' /etc/yum.repos.d/fedora-updates-testing.repo
# if TYPE == copr or local, enable nightly copr
RUN set -x && \
if [ "$TYPE" == "copr" -o "$TYPE" == "local" ]; then \
dnf -y install dnf-plugins-core; \
dnf -y copr enable 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 \
openssl \
python3-behave \
python3-pexpect \
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 \
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\
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