From 345ec873fbcc0a8a10d09a03feb0f7918048fbf4 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Thu, 26 Nov 2015 17:16:25 +0300 Subject: [PATCH] Add YAML sytax check Change-Id: Ida7aa1dc6410f91a87af805467051f9b3e64d1fc --- utils/jenkins/fuel_syntax_check.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/utils/jenkins/fuel_syntax_check.sh b/utils/jenkins/fuel_syntax_check.sh index bc16f111f4..d20872a2ef 100755 --- a/utils/jenkins/fuel_syntax_check.sh +++ b/utils/jenkins/fuel_syntax_check.sh @@ -1,5 +1,4 @@ #!/bin/bash - usage="$(basename "$0") [-h] [-m MODULE] [-a] -- runs syntax check for puppet modules, by default runs tests only for changed modules. where: @@ -88,7 +87,7 @@ function check_lint { # Function that checks syntax function check_syntax { exit_code=0 - all_files=`find . -name "*.pp" -o -name "*.erb" -o -name "*.sh" -o -path "*/files/ocf/*"` + all_files=`find . -name "*.pp" -o -name "*.erb" -o -name "*.sh" -o -name '*.yaml' -o -name '*.yml' -o -path "*/files/ocf/*"` for x in $all_files; do case $x in *.pp ) @@ -100,6 +99,12 @@ function check_syntax { *.sh ) bash -n $x ;; + *.yaml | *.yml ) + ruby -ryaml -e " + puts 'Checking YAML file: ${x}' + YAML.load_file('${x}') + exit(0)" + ;; *files/ocf/* ) case $(file --mime --brief $x) in *x-shellscript*)