Fuel plugin for Murano with MOS integration
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 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. set -eux
  3. . "$(dirname "$(readlink -f "$0")")"/functions.sh
  4. VERSION_FILE="build_version"
  5. # Describe version-depend variables:
  6. PUPPET_MURANO_REF=${PUPPET_MURANO_REF:-'stable/mitaka'}
  7. PUPPET_MURANO_GIT=${PUPPET_MURANO_GIT:-'https://github.com/openstack/puppet-murano.git'}
  8. # Add murano packages and some dependencies, from master pkg's repo:
  9. MURANO_PACKAGES_URLS_DEFAULT="http://mirror.fuel-infra.org/extras/murano-plugin-repos/ubuntu/9.0/pool/main/"
  10. MURANO_PACKAGES_URLS=${MURANO_PACKAGES_URLS:-${MURANO_PACKAGES_URLS_DEFAULT}}
  11. OVERRIDE_PUPPET_MURANO=${OVERRIDE_PUPPET_MURANO:-true}
  12. for url in ${MURANO_PACKAGES_URLS}; do
  13. if wget ${url} -O /dev/null ; then
  14. download_package 'deb' "${url}"
  15. else
  16. echo "WARNING: URL ${url} is broken"
  17. fi
  18. done
  19. # OVERRIDE_PUPPET_MURANO usually used only in CI systems
  20. if [[ "${OVERRIDE_PUPPET_MURANO}" == false ]]; then
  21. echo "INFO: OVERRIDE_PUPPET_MURANO flag found!"
  22. echo -e "WARNING: Puppet module will not be fetched with pre_build_hook!\nAssume, thats it was already fetched!"
  23. else
  24. download_puppet_module "murano" "${PUPPET_MURANO_GIT}" "${PUPPET_MURANO_REF}"
  25. fi
  26. # generate deb version file
  27. generate_deb_version_file "${VERSION_FILE}"
  28. # Update default informathion, in case OVERRIDE_PUPPET_MURANO was used
  29. pushd "${MODULES_DIR}/murano/"
  30. PUPPET_MURANO_REF=$(git rev-parse --abbrev-ref HEAD)
  31. PUPPET_MURANO_GIT=$(git config --get remote.origin.url)
  32. PUPPET_MURANO_COMMIT=$(git log -1 --pretty=%H)
  33. popd
  34. # add info about MURANO_TARBALL
  35. echo "PUPPET_MURANO_REF=${PUPPET_MURANO_REF}" >> "${VERSION_FILE}"
  36. echo "PUPPET_MURANO_GIT=${PUPPET_MURANO_GIT}" >> "${VERSION_FILE}"
  37. echo "PUPPET_MURANO_COMMIT=${PUPPET_MURANO_COMMIT}" >> "${VERSION_FILE}"