Fuel plugin to enable and configure networking-bgpvpn component
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pre_build_hook 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # Add here any the actions which are required before plugin build
  3. # like packages building, packages downloading from mirrors and so on.
  4. # The script should return 0 if there were no errors.
  5. set -eux
  6. # Networking bgpvpn
  7. NETWORKING_BGPVPN_REPO=${NETWORKING_BGPVPN_REPO:-https://github.com/openstack/networking-bgpvpn.git}
  8. NETWORKING_BGPVPN_BRANCH=${NETWORKING_BGPVPN_BRANCH:-stable/newton}
  9. #Networking odl
  10. NETWORKING_ODL_REPO=${NETWORKING_ODL_REPO:-https://github.com/openstack/networking-odl.git}
  11. NETWORKING_ODL_BRANCH=${NETWORKING_ODL_BRANCH:-stable/newton}
  12. # For which systems odl package should be build
  13. BUILD_FOR=${BUILD_FOR:-ubuntu}
  14. DIR="$(dirname `readlink -f $0`)"
  15. TMP_DIR="${DIR}/tmp"
  16. #Remove temporary files
  17. CLEANUP=${CLEANUP:-true}
  18. function cleanup {
  19. rm -rf "${TMP_DIR}"
  20. }
  21. function build_pkg {
  22. # clean up old packages
  23. rm -rf ${DIR}/repositories/${1}/*
  24. case $1 in
  25. ubuntu)
  26. pushd "${DIR}/repositories/${1}/"
  27. fpm --architecture all --force -s python -t deb -m 'mskalski@mirantis.com' \
  28. --python-disable-dependency oslo.config ${TMP_DIR}/networking-bgpvpn/setup.py
  29. # fpm -C is buggy https://github.com/jordansissel/fpm/issues/818
  30. # so we have to change the rootdir manually
  31. pushd ${TMP_DIR}/networking-bgpvpn/
  32. fpm --architecture all --force -s dir -t deb -m 'nikolas.hermanns@ericsson.com' \
  33. --config-files etc -n networking-bgpvpn-config -v 1.0 etc
  34. mv networking-bgpvpn-config_*.deb ${DIR}/repositories/${1}/
  35. popd
  36. # Networking odl is needed cause it is a dependencie. There is no way yet to make
  37. # the bgpvpn installation waiting for the ODL installation, when ODL installation
  38. # is optional: http://permalink.gmane.org/gmane.comp.cloud.openstack.devel/63333
  39. fpm --architecture all --force -s python -t deb -m 'nikolas.hermanns@ericsson.com' \
  40. --no-python-dependencies -d python-pbr -d python-babel -d python-neutron ${TMP_DIR}/networking_odl/setup.py
  41. popd
  42. ;;
  43. *) echo "Not supported system"; exit 1;;
  44. esac
  45. }
  46. command -v fpm >/dev/null 2>&1 || { echo >&2 "fpm ruby gem required but it's not installed. Aborting."; exit 1; }
  47. cleanup
  48. mkdir -p "${TMP_DIR}"
  49. pushd $TMP_DIR
  50. git clone $NETWORKING_BGPVPN_REPO networking-bgpvpn
  51. pushd networking-bgpvpn
  52. git checkout $NETWORKING_BGPVPN_BRANCH
  53. sed -i -- 's/sphinxcontrib-blockdiag//' ./requirements.txt
  54. sed -i -- 's/sphinxcontrib-seqdiag//' ./requirements.txt
  55. popd
  56. git clone $NETWORKING_ODL_REPO networking_odl
  57. pushd networking_odl
  58. git checkout $NETWORKING_ODL_BRANCH
  59. popd
  60. popd
  61. for system in $BUILD_FOR
  62. do
  63. build_pkg $system
  64. done
  65. if [ "$CLEANUP" != false ];then
  66. cleanup
  67. fi