Merge pull request #44 from chavafg/topic/kernel_config_version

kernel: Add config version file
This commit is contained in:
James O. D. Hunt 2018-05-29 08:45:14 +01:00 committed by GitHub
commit f73782bdb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 1 deletions

26
.ci/lib.sh Normal file
View File

@ -0,0 +1,26 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
# If we fail for any reason a message will be displayed
die(){
msg="$*"
echo "ERROR: $msg" >&2
exit 1
}
# Check that kata_confing_version file is updated
# when there is any change in the kernel directory.
# If there is a change in the directory, but the config
# version is not updated, return error.
check_kata_kernel_version(){
kernel_version_file="kernel/kata_config_version"
modified_files=$(git diff --name-only master..)
if echo "$modified_files" | grep "kernel/"; then
echo "$modified_files" | grep "$kernel_version_file" || \
die "Please bump version in $kernel_version_file"
fi
}

View File

@ -9,6 +9,10 @@ set -o errexit
set -o nounset
set -o pipefail
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
# This script will execute packaging tests suite
# TODO: Add steps needed to build packages
true
check_kata_kernel_version

View File

@ -0,0 +1 @@
1