0fc49bbf7d0c8667648f495c0b48044ac678ea47
[vpp.git] / extras / hs-test / script / build.sh
1 #!/usr/bin/env bash
2
3 if [ $(lsb_release -is) != Ubuntu ]; then
4         echo "Host stack test framework is supported only on Ubuntu"
5         exit 1
6 fi
7
8 if [ -z $(which ab) ]; then
9         echo "Host stack test framework requires apache2-utils to be installed"
10         echo "It is recommended to run 'sudo make install-dep'"
11         exit 1
12 fi
13
14 if [ -z $(which wrk) ]; then
15         echo "Host stack test framework requires wrk to be installed"
16         echo "It is recommended to run 'sudo make install-dep'"
17         exit 1
18 fi
19
20 source vars
21
22 bin=vpp-data/bin
23 lib=vpp-data/lib
24
25 mkdir -p ${bin} ${lib} || true
26
27 cp ${VPP_WS}/build-root/build-vpp_debug-native/vpp/bin/* ${bin}
28 res+=$?
29 cp -r ${VPP_WS}/build-root/build-vpp_debug-native/vpp/lib/x86_64-linux-gnu/* ${lib}
30 res+=$?
31 if [ $res -ne 0 ]; then
32         echo "Failed to copy VPP files. Is VPP built? Try running 'make build' in VPP directory."
33         exit 1
34 fi
35
36 docker build --build-arg UBUNTU_VERSION --build-arg http_proxy=$HTTP_PROXY \
37         -t hs-test/vpp -f docker/Dockerfile.vpp .
38 docker build --build-arg UBUNTU_VERSION --build-arg http_proxy=$HTTP_PROXY \
39         -t hs-test/nginx-ldp -f docker/Dockerfile.nginx .