Blame utils/docker/docker_run_build.sh

Packit Service 724aca
#!/bin/bash
Packit Service 724aca
#
Packit Service 724aca
#  Copyright (C) 2019 Intel Corporation.
Packit Service 724aca
#  All rights reserved.
Packit Service 724aca
#
Packit Service 724aca
#  Redistribution and use in source and binary forms, with or without
Packit Service 724aca
#  modification, are permitted provided that the following conditions are met:
Packit Service 724aca
#  1. Redistributions of source code must retain the above copyright notice(s),
Packit Service 724aca
#     this list of conditions and the following disclaimer.
Packit Service 724aca
#  2. Redistributions in binary form must reproduce the above copyright notice(s),
Packit Service 724aca
#     this list of conditions and the following disclaimer in the documentation
Packit Service 724aca
#     and/or other materials provided with the distribution.
Packit Service 724aca
#
Packit Service 724aca
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
Packit Service 724aca
#  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Packit Service 724aca
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
Packit Service 724aca
#  EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
Packit Service 724aca
#  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit Service 724aca
#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
Packit Service 724aca
#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
Packit Service 724aca
#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
Packit Service 724aca
#  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
Packit Service 724aca
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service 724aca
Packit Service 724aca
#
Packit Service 724aca
# docker_run_build.sh - is called inside a Docker container;
Packit Service 724aca
# prepares and runs memkind build for specified pull request number
Packit Service 724aca
#
Packit Service 724aca
set -e
Packit Service 724aca
Packit Service 724aca
export UTILS_PREFIX=utils/docker
Packit Service 724aca
Packit Service 724aca
if [ -n "$CODECOV_TOKEN" ]; then
Packit Service 724aca
    GCOV_OPTION="--enable-gcov"
Packit Service 724aca
fi
Packit Service 724aca
Packit Service 724aca
# if ndctl library version is specified install library
Packit Service 724aca
if [ -n "$NDCTL_LIBRARY_VERSION" ]; then
Packit Service 724aca
    "$UTILS_PREFIX"/docker_install_ndctl.sh
Packit Service 724aca
fi
Packit Service 724aca
Packit Service 724aca
# building memkind sources and tests
Packit Service 724aca
./autogen.sh
Packit Service 724aca
./configure --prefix=/usr $GCOV_OPTION
Packit Service 724aca
make -j "$(nproc --all)"
Packit Service 724aca
make -j "$(nproc --all)" checkprogs
Packit Service 724aca
Packit Service 724aca
# building RPM package
Packit Service 724aca
if [[ $(cat /etc/os-release) = *"Fedora"* ]]; then
Packit Service 724aca
    make -j "$(nproc --all)" rpm
Packit Service 724aca
fi
Packit Service 724aca
Packit Service 724aca
# installing memkind
Packit Service 724aca
sudo make install
Packit Service 724aca
Packit Service 724aca
# if TBB library version is specified install library and use it
Packit Service 724aca
# as MEMKIND_HEAP_MANAGER
Packit Service 724aca
if [ -n "$TBB_LIBRARY_VERSION" ]; then
Packit Service 724aca
    source "$UTILS_PREFIX"/docker_install_tbb.sh
Packit Service 724aca
    HEAP_MANAGER="TBB"
Packit Service 724aca
fi
Packit Service 724aca
if [ -n "$TEST_SUITE_NAME" ]; then
Packit Service 724aca
    "$UTILS_PREFIX"/docker_run_test.sh "$HEAP_MANAGER"
Packit Service 724aca
fi