hs-test: autodetect ubuntu version during build
[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 source vars
9
10 bin=vpp-data/bin
11 lib=vpp-data/lib
12
13 mkdir -p ${bin} ${lib} || true
14
15 cp ${VPP_WS}/build-root/build-vpp_debug-native/vpp/bin/* ${bin}
16 res+=$?
17 cp -r ${VPP_WS}/build-root/build-vpp_debug-native/vpp/lib/x86_64-linux-gnu/* ${lib}
18 res+=$?
19 if [ $res -ne 0 ]; then
20         echo "Failed to copy VPP files. Is VPP built? Try running 'make build' in VPP directory."
21         exit 1
22 fi
23
24 docker build --build-arg UBUNTU_VERSION -t hs-test/vpp -f docker/Dockerfile.vpp .
25 docker build --build-arg UBUNTU_VERSION -t hs-test/nginx-ldp -f docker/Dockerfile.nginx .