Merge pull request #13 from jodh-intel/ci-add-checkcommits

CI: Enable checkcommits
This commit is contained in:
Jose Carlos Venegas Munoz
2018-01-29 09:52:30 -06:00
committed by GitHub
3 changed files with 40 additions and 0 deletions

25
.ci/lib.sh Normal file
View File

@@ -0,0 +1,25 @@
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
export tests_repo="github.com/kata-containers/tests"
export tests_repo_dir="$GOPATH/src/$tests_repo"
clone_tests_repo()
{
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
# no existing clone.
if [ -d "$tests_repo_dir" -a -n "$KATA_CI_NO_NETWORK" ]
then
return
fi
go get -d -u "$tests_repo" || true
}
run_static_checks()
{
clone_tests_repo
bash "$tests_repo_dir/.ci/static-checks.sh"
}

View File

@@ -5,6 +5,9 @@
# SPDX-License-Identifier: Apache-2.0
#
cidir=$(dirname "$0")
bash "${cidir}/static-checks.sh"
#Note: If add clearlinux as supported CI use a stateless os-release file
source /etc/os-release

12
.ci/static-checks.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
run_static_checks