From 600e4271dd0fe6e9edf631daa7765aa9ad815273 Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Fri, 20 Dec 2013 12:14:56 +0400 Subject: [PATCH] Fix/improve projects_yaml_alphabetized script * use 'if ! command; then' condition to check diff * previously "diff projects_list projects_list.sorted > projects_list.diff" command returns exit code 1 and due to the 'bash -xe' it fails execution * make sort case insensitive Now this script prints something like: + sed -e '/^- project: /!d' -e 's/^- project: //' modules/openstack_project/templates/review.projects.yaml.erb + LC_ALL=C + sort projects_list -o projects_list.sorted + diff projects_list projects_list.sorted + echo 'The following projects should be alphabetized: ' The following projects should be alphabetized: + cat projects_list.diff + grep -e '> ' > openstack/openstack-doc-tools > stackforge/cliff > stackforge/entropy > stackforge/fuel-devops > stackforge/MRaaS > stackforge/puppet_openstack_builder > stackforge/stevedore > stackforge/tooz + exit 1 Change-Id: Ib6160dc401a70ada16fa961ae8d941b3e8845d4b --- .../files/slave_scripts/check_projects_yaml_alphabetized.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/jenkins/files/slave_scripts/check_projects_yaml_alphabetized.sh b/modules/jenkins/files/slave_scripts/check_projects_yaml_alphabetized.sh index fa75779b42..52bf97f5b2 100755 --- a/modules/jenkins/files/slave_scripts/check_projects_yaml_alphabetized.sh +++ b/modules/jenkins/files/slave_scripts/check_projects_yaml_alphabetized.sh @@ -12,11 +12,9 @@ sed -e '/^- project: /!d' -e 's/^- project: //' \ $OLDPWD/modules/openstack_project/templates/review.projects.yaml.erb \ > projects_list -LC_ALL=C sort projects_list -o projects_list.sorted +LC_ALL=C sort --ignore-case projects_list -o projects_list.sorted -diff projects_list projects_list.sorted > projects_list.diff - -if [[ -n `cat projects_list.diff` ]]; then +if ! diff projects_list projects_list.sorted > projects_list.diff; then echo "The following projects should be alphabetized: " cat projects_list.diff | grep -e '> ' exit 1