2017-09-07 15:25:11 -05:00
|
|
|
#!/bin/bash
|
2018-05-01 16:05:02 -06:00
|
|
|
set -e
|
2017-09-07 15:25:11 -05:00
|
|
|
|
|
|
|
# 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
|
2019-03-23 14:50:27 +01:00
|
|
|
if ! $base/tools/yaml-diff.py $f $base/$f; then
|
2017-09-07 15:25:11 -05:00
|
|
|
echo "ERROR: $base/$f is not up to date"
|
|
|
|
diff $f $base/$f
|
|
|
|
retval=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $retval
|