Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
CI: Enable checkcommits
Browse files Browse the repository at this point in the history
Require all PRs to contain a "Fixes #XXX" comment and a
"Signed-off-by:" comment by running the central static checks script.

Note that the static checks script will detect if the repository
contains golang code and only run those checks if it does.

Fixes #12.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Jan 29, 2018
1 parent 1295bd5 commit 895aad1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .ci/lib.sh
Original file line number Diff line number Diff line change
@@ -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"
}
3 changes: 3 additions & 0 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions .ci/static-checks.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 895aad1

Please sign in to comment.