summaryrefslogtreecommitdiffstats
path: root/fuel-plugin/pre_build_hook
blob: 9446d2a1a3ccdacce8f0201a0b2fa26be5beb3c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

set -eux

BUILD_FOR=${BUILD_FOR:-ubuntu}
DIR="$(dirname `readlink -f $0`)"

function build_pkg {
  case $1 in
    ubuntu)
      rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu

      # don't support online installation now
      # cd ${DIR}/repositories/ubuntu
      # Use aptititude; apt-get -d will skip download if package is already installed
      # sudo apt-get install aptitude -y
      # Download python packages into the repository
      # aptitude download python-virtualenv python-dev libffi-dev libssl-dev

      cd ${DIR}/..
      tar -czf ${DIR}/repositories/ubuntu/yardstick.tar.gz . --exclude=yardstick.tar.gz
      ;;

    *) echo "Not supported system"; exit 1;;
  esac
}

for system in $BUILD_FOR
do
  build_pkg $system
done