puppet-openstack-integration/playbooks/run-unit-tests.yaml

23 lines
877 B
YAML

- hosts: all
tasks:
- name: install ruby bundler and run it
shell:
cmd: |
if [ "{{ puppet_gem_version }}" != "latest" ]; then
export PUPPET_GEM_VERSION='~> {{ puppet_gem_version }}.0'
fi
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
export GEM_BIN_DIR=$GEM_HOME/bin
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install --bindir=${GEM_BIN_DIR}'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end
system(cmd)
EOF
$GEM_BIN_DIR/bundle install --retry 3
$GEM_BIN_DIR/bundle exec rake spec SPEC_OPTS='--format documentation'
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'