tripleo-common/tools/check_duplicate_jinja_blocks.sh
Lars Kellogg-Stedman 80fe68beb8 healthchecks: start to implement container healthchecks
This is the first in a series of patches that will implement
healthchecks for containerized services, conforming to the Docker
HEALTHCHECK api and to the container-healthchecks blueprint.  This
commit includes an example healtcheck (for heat-api), and modifies the
pep8 check to error out on duplicate jinja blocks in
container-images/tripleo_kolla_template_overrides.j2, since we will be
adding or modifying the _footer block for each service.

Change-Id: Id9fc19dd386e395317093d1723b836ae2807fdf0
Implements: blueprint container-healthchecks
Co-authored-by: Dan Prince <dprince@redhat.com>
Co-authored-by: Ian Main <imain@redhat.com>
2017-07-14 17:30:12 -04:00

22 lines
361 B
Bash
Executable File

#!/bin/sh
myname=${0##*/}
path=container-images/tripleo_kolla_template_overrides.j2
grep '{% block' $path |
sort |
uniq -c |
awk -v myname=$myname '
$1 == 2 {
printf "%s: found duplicate block for %s\n", myname, $4
retval=1
}
END {exit retval}
'
if [ $? -ne 0 ]; then
echo "$myname: duplicate jinja block declarations found in $path" >&2
exit 1
fi