From 9f84cc8f1c5c06bd990ff83dc5c9edbcabde98ea Mon Sep 17 00:00:00 2001 From: Salvador Fuentes Date: Wed, 6 Jun 2018 09:30:19 -0500 Subject: [PATCH] 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 --- .ci/lib.sh | 5 +++++ .ci/setup.sh | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.ci/lib.sh b/.ci/lib.sh index c5c8582f46..4f5486067d 100644 --- a/.ci/lib.sh +++ b/.ci/lib.sh @@ -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" +} diff --git a/.ci/setup.sh b/.ci/setup.sh index 1009f77f9b..e0b444ac8e 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -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"