X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fbuild.sh;h=e68705587e8086434207e5cd674cb5f2d75afeea;hb=aa5efc16674b1f14fcf7f3f0dfd98e98e7184b49;hp=2fd8c26d39d584071a365d654052db0a0faead2c;hpb=48d62412ec1e2302edae13e3eee15d1f38c2ab7b;p=apex.git diff --git a/ci/build.sh b/ci/build.sh index 2fd8c26d..e6870558 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -35,6 +35,7 @@ CACHE_DEST="" CACHE_DIR="cache" CACHE_NAME="apex-cache" MAKE_TARGETS="images" +REQUIRED_PKGS="rpm-build python-docutils" parse_cmdline() { while [ "${1:0:1}" = "-" ] @@ -82,6 +83,16 @@ run_make() { parse_cmdline "$@" +# Install build dependencies +for pkg in $REQUIRED_PKGS; do + if ! rpm -q $pkg > /dev/null; then + if ! sudo yum -y install $pkg > /dev/null; then + echo "Required package $pkg missing and installation failed." + exit 1 + fi + fi +done + if [ -n "$RELEASE" ]; then MAKE_ARGS+="RELEASE=$RELEASE "; fi # Get the Old Cache @@ -96,7 +107,7 @@ if [ -n "$CACHE_DEST" ]; then fi fi -#create build_output for legecy functionality compatibiltiy in jenkins +#create build_output for legacy functionality compatibility in jenkins if [[ ! -d ../build_output ]]; then rm -f ../build_output ln -s build/noarch/ ../build_output @@ -128,6 +139,15 @@ if [[ "$MAKE_TARGETS" == "images" ]]; then fi fi +# Make sure python is installed +if ! rpm -q python34-devel > /dev/null; then + sudo yum install -y epel-release + if ! sudo yum install -y python34-devel; then + echo "Failed to install python34-devel package..." + exit 1 + fi +fi + # Execute make against targets for t in $MAKE_TARGETS; do run_make $t