fuel-plugin: Initial version targeting Fuel8
[vswitchperf.git] / fuel-plugin-vsperf / pre_build_hook
1 #!/bin/bash
2
3 # Add here any the actions which are required before plugin build
4 # like packages building, packages downloading from mirrors and so on.
5 # The script should return 0 if there were no errors.
6 #!/bin/bash
7
8 set -eux
9
10 VSPERF_REV=${VSPERF_REV:-stable/brahmaputra}
11 BUILD_FOR=${BUILD_FOR:-ubuntu}
12 DIR="$(dirname `readlink -f $0`)"
13
14 INCLUDE_DEPENDENCIES=${INCLUDE_DEPENDENCIES:-true}
15
16 function build_pkg {
17   case $1 in
18     ubuntu)
19       cd ${DIR}
20       rm -rf vswitchperf
21       git clone https://gerrit.opnfv.org/gerrit/vswitchperf
22       cd vswitchperf && git checkout ${VSPERF_REV} && cd ..
23       rm -rf vswitchperf/.git
24       tar cfvz ${DIR}/repositories/ubuntu/vswitchperf.tgz vswitchperf
25       rm -rf vswitchperf
26       ;;
27     *) echo "Not supported system"; exit 1;;
28   esac
29 }
30
31 for system in $BUILD_FOR
32 do
33   build_pkg $system
34 done
35
36