system-config/modules/jenkins/files/slave_scripts/check_projects_yaml_alphabetized.sh
Anita Kuno 0f5e254d16 Fix the yaml-alphabetized job
Added $OLDPWD/ to the beginning of the path to
review.projects.yaml.erb. Hopefully the script can find the file
now and the job will run successfully.

Change-Id: I32ed800d79a39e47ae20c54147f2e4db2725c97b
2013-12-18 13:25:27 -05:00

28 lines
653 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: //' \
$OLDPWD/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