From 811a5437a44c66918473a457c1626018b5236bd3 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Fri, 18 May 2018 15:59:58 +0100 Subject: [PATCH] CI: Add CI scripts Create a basic set of CI scripts that just run the static checks for now. Fixes #101. Signed-off-by: James O. D. Hunt --- .ci/lib.sh | 25 +++++++++++++++++++++++++ .ci/run.sh | 11 +++++++++++ .ci/static-checks.sh | 12 ++++++++++++ .travis.yml | 12 ++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 .ci/lib.sh create mode 100755 .ci/run.sh create mode 100755 .ci/static-checks.sh create mode 100644 .travis.yml diff --git a/.ci/lib.sh b/.ci/lib.sh new file mode 100644 index 0000000000..c5c8582f46 --- /dev/null +++ b/.ci/lib.sh @@ -0,0 +1,25 @@ +# +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +export tests_repo="${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" +} diff --git a/.ci/run.sh b/.ci/run.sh new file mode 100755 index 0000000000..a9d5eafd24 --- /dev/null +++ b/.ci/run.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +cidir=$(dirname "$0") +bash "${cidir}/static-checks.sh" diff --git a/.ci/static-checks.sh b/.ci/static-checks.sh new file mode 100755 index 0000000000..cfadeaf8a8 --- /dev/null +++ b/.ci/static-checks.sh @@ -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 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..7e3018601c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +# +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +dist: trusty + +language: bash + +script: + - ".ci/run.sh"