You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
669 B

  1. #!/bin/bash
  2. set -euxo pipefail -o noglob
  3. export LC_ALL=C.UTF-8
  4. export LANG=C.UTF-8
  5. _PATH='roles'
  6. _EXCLUDE=""
  7. while [[ $# -gt 0 ]] ; do
  8. case $1 in
  9. -e|--exclude)
  10. _EXCLUDE="${_EXCLUDE} -not -path ${_PATH}/$2/*"
  11. shift
  12. shift
  13. ;;
  14. -i|--include)
  15. _PATH="${_PATH}/$2"
  16. shift
  17. shift
  18. ;;
  19. -h|--help)
  20. echo "Usage: molecule_run.sh [-h|--help] [-e|--exclude] [-i|--include]"
  21. exit 0
  22. ;;
  23. esac
  24. done
  25. for d in $(find ${_PATH} ${_EXCLUDE} -name molecule -type d)
  26. do
  27. pushd $(dirname $d)
  28. molecule test --all
  29. popd
  30. done