tripleo-heat-templates/tools/check-up-to-date.sh
Ben Nemec 1c9553c37a Add pep8 check that generated environments are up to date
This check ensures that if a parameter is changed that would affect
a generated environment then the environment must be updated before
pep8 will pass.  It will also catch any mistaken hand edits to the
generated files.

bp generated-environments

Change-Id: I2d12992ed55f963285422e1282a4cee06e989b6d
2017-09-07 15:30:31 -05:00

28 lines
580 B
Bash
Executable File

#!/bin/bash
# Report an error if the generated sample environments are not in sync with
# the current configuration and templates.
echo 'Verifying that generated environments are in sync'
tmpdir=$(mktemp -d)
trap "rm -rf $tmpdir" EXIT
./tripleo_heat_templates/environment_generator.py sample-env-generator/ $tmpdir/environments
base=$PWD
retval=0
cd $tmpdir
file_list=$(find environments -type f)
for f in $file_list; do
if ! diff -q $f $base/$f; then
echo "ERROR: $base/$f is not up to date"
diff $f $base/$f
retval=1
fi
done
exit $retval