-
Notifications
You must be signed in to change notification settings - Fork 70
/
build.sh
executable file
·49 lines (30 loc) · 1.14 KB
/
build.sh
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
#!/bin/bash -ex
# Build script for sonic-mgmt-framework.
[[ ! -z ${DISTRO} ]] || DISTRO=buster
# REDIS
sudo apt-get install -y redis-server
sudo sed -ri 's/^# unixsocket/unixsocket/' /etc/redis/redis.conf
sudo sed -ri 's/^unixsocketperm .../unixsocketperm 777/' /etc/redis/redis.conf
sudo sed -ri 's/redis-server.sock/redis.sock/' /etc/redis/redis.conf
sudo service redis-server start
# LIBYANG
sudo dpkg -i buildimage/target/debs/${DISTRO}/libyang*1.0.73*.deb
# Install from "requirement" files in sonic-mgmt-framework/tools/test directory.
pushd sonic-mgmt-framework/tools/test
[[ ! -f apt_requirements.txt ]] || \
sed 's/#.*//' apt_requirements.txt | xargs -r sudo apt-get install -y
[[ ! -f python2_requirements.txt ]] || \
sudo pip install --no-cache-dir -r python2_requirements.txt
[[ ! -f python3_requirements.txt ]] || \
sudo pip3 install --no-cache-dir -r python3_requirements.txt
popd
# Build sonic-mgmt-common
pushd sonic-mgmt-common
NO_TEST_BINS=1 dpkg-buildpackage -rfakeroot -b -us -uc
popd
# Build sonic-mgmt-framework
pushd sonic-mgmt-framework
dpkg-buildpackage -rfakeroot -b -us -uc
popd
mkdir -p target
cp *.deb target/