CI: Install bats from sources

CentOS and some versions of Ubuntu do not provide
bats in their default repository. This change installs
bats from sources.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
This commit is contained in:
Salvador Fuentes 2018-06-06 09:30:19 -05:00
parent 6c8c60db8a
commit 9f84cc8f1c
2 changed files with 12 additions and 5 deletions

View File

@ -23,3 +23,8 @@ run_static_checks()
clone_tests_repo
bash "$tests_repo_dir/.ci/static-checks.sh"
}
install_bats()
{
bash "$tests_repo_dir/.ci/install_bats.sh"
}

View File

@ -8,20 +8,22 @@
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
bash "${cidir}/static-checks.sh"
#Note: If add clearlinux as supported CI use a stateless os-release file
source /etc/os-release
install_bats
if [ "$ID" == fedora ];then
sudo -E dnf -y install automake bats yamllint coreutils moreutils
sudo -E dnf -y install automake yamllint coreutils moreutils
elif [ "$ID" == centos ];then
sudo -E yum -y install automake bats yamllint coreutils moreutils
sudo -E yum -y install automake yamllint coreutils moreutils
elif [ "$ID" == ubuntu ];then
#bats isn't available for Ubuntu trusty, need for travis
sudo add-apt-repository -y ppa:duggan/bats
sudo apt-get -qq update
sudo apt-get install -y -qq automake bats qemu-utils python-pip coreutils moreutils
sudo apt-get install -y -qq automake qemu-utils python-pip coreutils moreutils
sudo pip install yamllint
else
echo "Linux distribution not supported"