X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fglobal%2Freleng-macros.yml;h=17c451c9d691c1830899113193a9467380f53409;hb=b3daaaf3d9cf201c37f68f47011fd73ac069fd1a;hp=609157134cc90fa7a02521a4544137ca33a35ddb;hpb=500717bd3b46eb4855428eead7894141bf6d6a15;p=releng.git diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index 609157134..17c451c9d 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -404,18 +404,19 @@ # generate and upload lint log echo "Running yaml code on $PROJECT ..." + # Get list of yaml files + YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") + # Ensure we start with a clean environment rm -f yaml-violation.log lint.log - # Get number of yaml violations. If none, this will be an - # empty string: "" - find . \ - -type f -name "*.yml" -print \ - -o -name "*.yaml" -print | \ - xargs yamllint > yaml-violation.log || true + # Yamllint files only in patchset + for yamlfile in $YAML_FILES; do + yamllint $yamlfile >> yaml-violation.log || true + done if [ -s "yaml-violation.log" ]; then - SHOWN=$(cat yaml-violation.log| grep -v "^$" |wc -l) + SHOWN=$(grep -c -v "^$" yaml-violation.log) echo -e "First $SHOWN shown\n---" > lint.log cat yaml-violation.log >> lint.log sed -r -i '4,$s/^/ /g' lint.log