aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/jenkins.sh
blob: b19f0c6fa8eb353bc8e5bdea3d3d13b55c8cbcb2 (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
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
#!/usr/bin/env bash
export PATH="$PATH:$HOME/osmo-ci/scripts"

set -ex

base="$PWD"
deps="$base/deps"
inst="$deps/install"

mkdir "$deps" || true
rm -rf "$inst"

marker() {
	set +x
	echo
	echo
	echo
	echo " =============================== $@ ==============================="
	echo
	set -x
}

build_dep() {
	project="$1"
	branch="$2"
	marker $project
	if [ -z "$project" ]; then
		echo "internal failure"
		exit 1
	fi
	cd "$deps"
	rm -rf "$project"
	osmo-deps.sh "$project"
	cd "$project"
	if [ -n "$branch" ]; then
		git checkout "$branch"
	fi
	git rev-parse HEAD
	autoreconf --install --force
	./configure --prefix="$inst"
	$MAKE $PARALLEL_MAKE install
}

build_dep libosmocore

# All below builds want this PKG_CONFIG_PATH
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"

build_dep libosmo-abis
build_dep libosmo-netif sysmocom/sctp
build_dep libosmo-sccp sysmocom/iu
build_dep libasn1c

# the asn1c binary is used by the 'regen' target below
build_dep asn1c aper-prefix

marker osmo-iuh
cd "$base"

autoreconf --install --force
./configure

# Verify that checked-in asn1 code is identical to regenerated asn1 code
PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen

# attempt to settle the file system
sleep 1

git status
git diff | cat

if ! git diff-files --quiet ; then
	echo "ERROR: 'make -C src regen' does not match committed asn1 code"
	exit 1
fi

$MAKE $PARALLEL_MAKE
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
  || cat-testlogs.sh
LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \
  || cat-testlogs.sh