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"