aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ci-unit-tests.sh
blob: 1585d6658cbb9f81ba714b735d7e2e7e4687a077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 -p .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'