Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix travis changed module detection #174

Merged
merged 1 commit into from
Dec 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .travis.sh
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