da1465db09
When putting the alphabetize script into slave_scripts, we run the risk of bugs entering the script without being tested before they are rolled live and become part of the gate. This just recently happened. Instead, move it to the tools dir, which makes it easy for a dev to run, and also which makes changes to the script self-gating. Change-Id: Ia5e1870f84b0cbc0c6f172b6982263440af5575e
31 lines
827 B
Bash
Executable File
31 lines
827 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
|
|
|
|
if [ -f $OLDPWD/modules/openstack_project/templates/review.projects.yaml.erb ]
|
|
then
|
|
PROJECTS_LIST=$OLDPWD/modules/openstack_project/templates/review.projects.yaml.erb
|
|
else
|
|
PROJECTS_LIST=$OLDPWD/modules/openstack_project/files/review.projects.yaml
|
|
fi
|
|
|
|
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
|