Merge "Bugfix: network_utilization: parse error"
[yardstick.git] / fuel-plugin / pre_build_hook
1 #!/bin/bash
2
3 set -eux
4
5 BUILD_FOR=${BUILD_FOR:-ubuntu}
6 DIR="$(dirname `readlink -f $0`)"
7
8 function build_pkg {
9   case $1 in
10     ubuntu)
11       rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu
12
13       # fixme: don't support offline installation now since pip in
14       #  deployment_scripts/install.sh needs to access to internet
15       #
16       # cd ${DIR}/repositories/ubuntu
17       # Use aptititude; apt-get -d will skip download if package is already installed
18       # sudo apt-get install aptitude -y
19       # Download python packages into the repository
20       # aptitude download python-virtualenv python-dev libffi-dev libssl-dev
21
22       cd ${DIR}/..
23       tar -czf ${DIR}/repositories/ubuntu/yardstick.tar.gz . --exclude=yardstick.tar.gz
24       ;;
25
26     *) echo "Not supported system"; exit 1;;
27   esac
28 }
29
30 for system in $BUILD_FOR
31 do
32   build_pkg $system
33 done