-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If new module was added the dif contains only + and no - so from now we chack on ^+ in Puppetfile diff.
- Loading branch information
Showing
1 changed file
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
#!/bin/bash | ||
set -ev | ||
MODS="$(git diff HEAD~1 Puppetfile | grep ^- -B2 | grep mod | cut -d"'" -f2)" | ||
MODS="$(git diff HEAD~1 Puppetfile | grep ^+ -B2 | grep mod | cut -d"'" -f2)" | ||
rake validate_puppetfile SPEC_OPTS='--format documentation --color --backtrace' || exit 1 | ||
for module in ${MODS}; do | ||
if [ -e ./${module}/Rakefile ]; then | ||
rake test_modules[./${module}/Rakefile] SPEC_OPTS='--format documentation --color --backtrace' || exit 1 | ||
else | ||
echo "Missing ./${module}/Rakefile, not running spec tests." | ||
fi | ||
done | ||
if [ "${MODS}" != "" ]; then | ||
for module in ${MODS}; do | ||
if [ -e ./${module}/Rakefile ]; then | ||
rake test_modules[./${module}/Rakefile] SPEC_OPTS='--format documentation --color --backtrace' || exit 1 | ||
else | ||
echo "Missing ./${module}/Rakefile, not running spec tests. You have to manually check whether this is OK." | ||
exit 1 | ||
fi | ||
done | ||
else | ||
echo "No changed module detected. You have to manually check whether this is OK." | ||
git diff HEAD~1 Puppetfile | ||
exit 1 | ||
fi |