summaryrefslogtreecommitdiffstats
path: root/common/build-lava
blob: 3ddc696f7643fa0fc0a4f70331a4c14546175334 (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
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
#!/bin/sh
# This file is copied in {lava-master/lava-slave}/scripts

if [ $# -le 1 ];then
	echo "Build any LAVA compoments from source with specific version tag"
	echo "Usage: $0 LAVAcompoment LAVA-git-tag LAVA-pkg-git-tag"
	exit 1
fi

# common build deps
DEBIAN_FRONTEND=noninteractive apt-get -y install python3-sphinx git devscripts || exit $?

case $1 in
lava-server)
	# package dependencies
	DEBIAN_FRONTEND=noninteractive apt-get -y install \
	python-mock \
	apache2 \
	debootstrap \
	ntfs-3g \
	debhelper \
	debootstrap \
	libguestfs-tools \
	build-essential \
	docbook-xsl \
	xsltproc \
	gunicorn3 \
	ntp \
	nodejs \
	node-uglify \
	libjs-excanvas \
	libjs-jquery-cookie \
	libjs-jquery-watermark \
	libjs-jquery-flot \
	libjs-jquery-ui \
	python3-django-restricted-resource \
	python3-django-auth-ldap \
	python3-django-tables2 \
	python3-django \
	python3-guestfs \
	python3-netifaces \
	python3-markdown \
	python3-nose \
	python3-pexpect \
	python3-psycopg2 \
	python3-requests \
	python3-simplejson \
	python3-yaml \
	python3-zmq \
	python3-sphinx-bootstrap-theme \
	pep8 \
	python-pep8 \
	python3-voluptuous \
	python3-dateutil \
	python3-voluptuous \
	systemd-sysv \
	tftpd-hpa \
	lxc \
	sudo \
	telnet \
	bridge-utils || exit $?

	DEBIAN_FRONTEND=noninteractive apt-get -y install lava-tool lavapdu-client lava-coordinator || exit $?
;;
lava-dispatcher)
	# build dependencies
	DEBIAN_FRONTEND=noninteractive apt-get -y install python3-setuptools || exit $?
	# package dependencies
	DEBIAN_FRONTEND=noninteractive apt-get -y install \
	python3-serial \
	python3-configobj \
	python3-pyudev \
	python3-setproctitle \
	python3-guestfs \
	sudo \
	telnet \
	systemd-sysv \
	python3-netifaces \
	python3-nose \
	python3-pexpect \
	python3-requests \
	python3-yaml \
	python3-zmq || exit $?
;;
*)
	echo "Unknow compoments $1"
	exit 1
;;
esac
if [ ! -e /root/lava-server ];then
	git clone https://github.com/Linaro/lava-server.git /root/lava-server || exit $?
fi
cd /root/lava-server
git checkout $2 || exit $?

if [ ! -e /root/$1 ];then
	git clone https://github.com/Linaro/$1.git /root/$1 || exit $?
fi
cd /root/$1
git checkout $2 || exit $?

git config --global user.name "Docker Build"
git config --global user.email "info@kernelci.org"

# By default, debian-dev-build.sh use always the last tag as version
sed -i "s,VERSION=.*,VERSION=$3," /root/lava-server/share/debian-dev-build.sh

echo "cd \${DIR} && dpkg -i *.deb" >> /root/lava-server/share/debian-dev-build.sh

cd /root/$1
/root/lava-server/share/debian-dev-build.sh -p $1 -b $3
exit $?