Add docker-compose.yml to be used for compile tests
Ideally this will be expanded in order to simplify compilation tests of DAHDI on supported distributions. Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This commit is contained in:
10
test/docker/centos6
Normal file
10
test/docker/centos6
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM centos:6
|
||||
|
||||
RUN yum update -y
|
||||
RUN yum install -y \
|
||||
gcc \
|
||||
git \
|
||||
make \
|
||||
wget
|
||||
RUN yum install -y kernel-devel
|
||||
CMD ["/source/test/test-build.sh"]
|
||||
10
test/docker/centos7
Normal file
10
test/docker/centos7
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM centos:7
|
||||
|
||||
RUN yum update -y
|
||||
RUN yum install -y \
|
||||
gcc \
|
||||
git \
|
||||
make \
|
||||
wget
|
||||
RUN yum install -y kernel-devel.x86_64 0:3.10.0-1062.12.1
|
||||
CMD ["/source/test/test-build.sh"]
|
||||
12
test/docker/debianstable
Normal file
12
test/docker/debianstable
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM debian:stable
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
git \
|
||||
linux-headers-amd64 \
|
||||
make \
|
||||
wget
|
||||
|
||||
CMD ["/source/test/test-build.sh"]
|
||||
12
test/docker/debiantesting
Normal file
12
test/docker/debiantesting
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM debian:testing
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
git \
|
||||
linux-headers-amd64 \
|
||||
make \
|
||||
wget
|
||||
|
||||
CMD ["/source/test/test-build.sh"]
|
||||
11
test/docker/fedorarawhide
Normal file
11
test/docker/fedorarawhide
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM fedora:rawhide
|
||||
|
||||
RUN dnf update -y && dnf install -y \
|
||||
diffutils \
|
||||
gcc \
|
||||
git \
|
||||
kmod \
|
||||
make \
|
||||
wget
|
||||
RUN dnf update -y && dnf install -y kernel-devel
|
||||
CMD ["/source/test/test-build.sh"]
|
||||
41
test/test-build.sh
Executable file
41
test/test-build.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
JOBS=$1
|
||||
fi
|
||||
|
||||
if command -v apt >/dev/null; then
|
||||
if [ ! -e /root/last-update ]; then
|
||||
date > /root/last-update
|
||||
fi
|
||||
if [ -z "$(find /root/last-update -mmin -60)" ]; then
|
||||
apt-get update && apt-get install -y linux-headers-amd64
|
||||
date > /root/last-update
|
||||
fi
|
||||
KERNELS=$(find /usr/src -maxdepth 1 -type d -name 'linux-headers-*' -not -name '*common*')
|
||||
else
|
||||
if command -v dnf > /dev/null ; then
|
||||
dnf update kernel-devel
|
||||
else
|
||||
yum update kernel-devel
|
||||
fi
|
||||
KERNELS=$(find /usr/src/kernels -maxdepth 1 -type d -regextype sed -regex '.*[.]\(el\|fc\).*')
|
||||
fi
|
||||
|
||||
if [ "$KERNELS" = "" ]; then
|
||||
echo >&2 "Failed to find any kernels"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy the source into the container so we can run builds in parallel
|
||||
rm -fr /root/code
|
||||
cp -fr /source /root/code
|
||||
cd /root/code
|
||||
|
||||
for KSRC in $KERNELS ; do
|
||||
echo "Building against $KSRC"
|
||||
export KSRC=$KSRC
|
||||
make -s clean
|
||||
make -s -j $(grep -c "^processor" /proc/cpuinfo)
|
||||
done
|
||||
Reference in New Issue
Block a user