2020-04-01 14:25:28 +00:00
|
|
|
#!/bin/bash
|
2022-04-29 07:09:12 +00:00
|
|
|
set -euxo pipefail -o noglob
|
2020-04-01 14:25:28 +00:00
|
|
|
|
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
export LANG=C.UTF-8
|
|
|
|
|
2022-04-29 07:09:12 +00:00
|
|
|
_PATH='roles'
|
|
|
|
_EXCLUDE=""
|
|
|
|
|
|
|
|
while [[ $# -gt 0 ]] ; do
|
|
|
|
case $1 in
|
|
|
|
-e|--exclude)
|
|
|
|
_EXCLUDE="${_EXCLUDE} -not -path ${_PATH}/$2/*"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-i|--include)
|
|
|
|
_PATH="${_PATH}/$2"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-h|--help)
|
|
|
|
echo "Usage: molecule_run.sh [-h|--help] [-e|--exclude] [-i|--include]"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
for d in $(find ${_PATH} ${_EXCLUDE} -name molecule -type d)
|
2020-04-01 14:25:28 +00:00
|
|
|
do
|
2021-11-29 21:39:21 +00:00
|
|
|
pushd $(dirname $d)
|
2020-04-01 14:25:28 +00:00
|
|
|
molecule test --all
|
2021-11-29 21:39:21 +00:00
|
|
|
popd
|
|
|
|
done
|