aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ci-unit-tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ci-unit-tests.sh')
-rwxr-xr-xscripts/ci-unit-tests.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/ci-unit-tests.sh b/scripts/ci-unit-tests.sh
new file mode 100755
index 0000000..a8d57ff
--- /dev/null
+++ b/scripts/ci-unit-tests.sh
@@ -0,0 +1,19 @@
+#!/bin/bash -xe
+
+if [ "$#" -ne 1 ]; then
+ echo "Usage: $0 <puppet_version>"
+ exit 1
+fi
+
+puppet_version=$1
+if [ "$puppet_version" != "latest" ]; then
+ export PUPPET_GEM_VERSION="~> $puppet_version.0"
+fi
+
+mkdir .bundled_gems
+export GEM_HOME=`pwd`/.bundled_gems
+gem install bundler --no-rdoc --no-ri --verbose
+$GEM_HOME/bin/bundle install --retry 3
+$GEM_HOME/bin/bundle exec rake syntax
+$GEM_HOME/bin/bundle exec rake lint
+$GEM_HOME/bin/bundle exec rake spec SPEC_OPTS='--format documentation'