.gitlab-ci.yml: simplify (and fix) check-DEVELOPERS
PATCH v2 1/1 .gitlab-ci.yml: simplify (and fix) check-DEVELOPERS
The check-DEVELOPERS test would always fail, because && will return the exit code of the left-hand side if not 0, so it *always* returns 1.
But in fact, the test can be simplified quite a lot: we can run getdeveloper directly, without arguments. That should just print 'No action specified', but it will also print any syntax errors it encountered. So we can just 'grep -v' the expected output away; if there is anything more, grep will return 0, but if there is nothing more, it will return 1. So we just need to invert the result.
Incidentally, this also fixes the incorrect remaining reference to support/scripts.
--- .gitlab-ci.yml | 4 +--- .gitlab-ci.yml.in | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
.gitlab-ci.yml +1 -3
@@ -36,9 +36,7 @@ check-gitlab-ci.yml: check-DEVELOPERS: script: - - PYTHONPATH=$PWD/support/scripts - python -c 'from getdeveloperlib import parse_developers; parse_developers()' | - grep . && exit 1 + - ! utils/get-developers | grep -v 'No action specified' .defconfig: &defconfig # Running the defconfigs for every push is too much, so limit to
.gitlab-ci.yml.in +1 -3
@@ -36,9 +36,7 @@ check-gitlab-ci.yml: check-DEVELOPERS: script: - - PYTHONPATH=$PWD/support/scripts - python -c 'from getdeveloperlib import parse_developers; parse_developers()' | - grep . && exit 1 + - ! utils/get-developers | grep -v 'No action specified' .defconfig: &defconfig # Running the defconfigs for every push is too much, so limit to
Signature · 1 line
2.13.1
Thomas Petazzoni
AppliedPATCH v2 1/1 .gitlab-ci.yml: simplify (and fix) check-DEVELOPERS
Hello,
Quoted 11 lines · Arnout Vandecappelle (Essensium/Mind)
The check-DEVELOPERS test would always fail, because && will return the exit code of the left-hand side if not 0, so it *always* returns 1.
But in fact, the test can be simplified quite a lot: we can run getdeveloper directly, without arguments. That should just print 'No action specified', but it will also print any syntax errors it encountered. So we can just 'grep -v' the expected output away; if there is anything more, grep will return 0, but if there is nothing more, it will return 1. So we just need to invert the result.
Quoted 8 lines
Incidentally, this also fixes the incorrect remaining reference to support/scripts.
--- .gitlab-ci.yml | 4 +--- .gitlab-ci.yml.in | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com