blob: 2c12ff792e21c7fa68fb639a642470e5b9d7284a (
plain)
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
|
#!/bin/bash
#
#
# Test librdkafka packages in <rpmdirectory> using docker.
# Must be executed from the librdkafka top-level directory.
#
# Usage:
# packaging/rpm/test-on-docker.sh [<rpm-dir>]
set -ex
if [[ ! -f configure.self ]]; then
echo "Must be executed from the librdkafka top-level directory"
exit 1
fi
_DOCKER_IMAGES="centos:7 redhat/ubi8:8.5-226"
_RPMDIR=artifacts
if [[ -n $1 ]]; then
_RPMDIR="$1"
fi
_RPMDIR=$(readlink -f $_RPMDIR)
if [[ ! -d $_RPMDIR ]]; then
echo "$_RPMDIR does not exist"
exit 1
fi
fails=""
for _IMG in $_DOCKER_IMAGES ; do
if ! docker run \
-t \
-v $_RPMDIR:/rpms \
-v $(readlink -f packaging/rpm/tests):/v \
$_IMG \
/v/run-test.sh $_IMG ; then
echo "ERROR: $_IMG FAILED"
fails="${fails}$_IMG "
fi
done
if [[ -n $fails ]]; then
echo "##################################################"
echo "# Package verification failed for:"
echo "# $fails"
echo "# See previous errors"
echo "##################################################"
exit 1
fi
exit 0
|