9446d2a1a3ccdacce8f0201a0b2fa26be5beb3c9
[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       # don't support online installation now
14       # cd ${DIR}/repositories/ubuntu
15       # Use aptititude; apt-get -d will skip download if package is already installed
16       # sudo apt-get install aptitude -y
17       # Download python packages into the repository
18       # aptitude download python-virtualenv python-dev libffi-dev libssl-dev
19
20       cd ${DIR}/..
21       tar -czf ${DIR}/repositories/ubuntu/yardstick.tar.gz . --exclude=yardstick.tar.gz
22       ;;
23
24     *) echo "Not supported system"; exit 1;;
25   esac
26 }
27
28 for system in $BUILD_FOR
29 do
30   build_pkg $system
31 done