project-config/tools/check_projects_yaml_alphabetized.sh
James E. Blair 312e958fb1 Fix test jobs
Make the necessary changes for the jobs ported over from infra/config
to work in this repo.

Also, make the irc access job voting.

Add a .gitignore file.

Change-Id: If3b6c214881205a25e8148c23c3411338b66ef90
2014-09-25 16:40:07 +00:00

25 lines
593 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
PROJECTS_LIST=$OLDPWD/$1
sed -e '/^- project: /!d' -e 's/^- project: //' $PROJECTS_LIST > projects_list
LC_ALL=C sort --ignore-case projects_list -o projects_list.sorted
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
else
echo "Projects alphabetized."
fi
popd