system-config/modules/jenkins/files/slave_scripts/check_projects_yaml_alphabetized.sh
Sergey Lukjanov 4303c893c3 Add job to check projects.yaml alphabetized
It checks that projects.yaml alphabetized and prints list of projects
that should be sorted. Additionally, it adds new job as non-voting to
the openstack-infra/config project.

Change-Id: I9c0eb5072a5b1446ee654296e60c1f8587a3a7ad
2013-12-13 03:38:51 +04:00

28 lines
645 B
Bash
Executable File

#!/bin/bash -xe
# It checks that projects.yaml alphabetized and prints list of projects that
# should be sorted.
export TMPDIR=`/bin/mktemp -d`
trap "rm -rf $TMPDIR" EXIT
pushd $TMPDIR
sed -e '/^- project: /!d' -e 's/^- project: //' \
modules/openstack_project/templates/review.projects.yaml.erb \
> projects_list
LC_ALL=C sort projects_list -o projects_list.sorted
diff projects_list projects_list.sorted > projects_list.diff
if [[ -n `cat projects_list.diff` ]]; then
echo "The following projects should be alphabetized: "
cat projects_list.diff | grep -e '> '
exit 1
else
echo "Projects alphabetized."
fi
popd