aboutsummaryrefslogtreecommitdiffstats
path: root/common/build-lava
blob: e1a8e3bdae2372b64e1d5095981a677deddc1ab6 (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
113
114
115
116
117
118
119
120
121
122
123
124
#!/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 \
	gunicorn \
	ntp \
	nodejs \
	node-uglify \
	libjs-excanvas \
	libjs-jquery-cookie \
	libjs-jquery-watermark \
	libjs-jquery-flot \
	libjs-jquery-ui \
	python-django \
	python-json-schema-validator \
	python-configglue \
	python-twisted\
	python-guestfs \
	python-configobj \
	python-lzma \
	python-magic \
	python-netifaces \
	python-nose \
	python-pexpect \
	python-pyudev \
	python-requests \
	python-yaml \
	python-zmq \
	python3-sphinx-bootstrap-theme \
	pep8 \
	python-pep8 \
	python-voluptuous \
	python-dateutil \
	python-django-auth-ldap \
	python-django-restricted-resource \
	python-django-tables2 \
	python-docutils \
	python-jinja2 \
	python-markdown \
	python-psycopg2 \
	python-voluptuous \
	python-sphinx \
	python-sphinx-bootstrap-theme \
	python-mocker \
	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 python-setuptools || exit $?
	# package dependencies
	DEBIAN_FRONTEND=noninteractive apt-get -y install python-serial \
	python-daemon \
	python-guestfs \
	sudo \
	telnet \
	python-configobj \
	python-lzma \
	python-magic \
	python-netifaces \
	python-nose \
	python-pexpect \
	python-pyudev \
	python-requests \
	python-tz \
	python-yaml \
	python-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 $?