Jakub Josef | 25c0ea5 | 2017-04-27 17:46:27 +0200 | [diff] [blame^] | 1 | package com.mirantis.mk |
| 2 | |
| 3 | /** |
| 4 | * Ruby functions |
| 5 | */ |
| 6 | |
| 7 | def ensureRubyEnv(rubyVersion="2.4.0"){ |
| 8 | sh """rbenv install ${rubyVersion}; |
| 9 | rbenv local ${rubyVersion}; |
| 10 | rbenv exec gem update --system""" |
| 11 | } |
| 12 | def installKitchen(){ |
| 13 | sh """rbenv exec gem install bundler; |
| 14 | rbenv exec gem install test-kitchen""" |
| 15 | } |
| 16 | |
| 17 | def runKitchenTests(){ |
| 18 | runKitchenCommand("converge") |
| 19 | runKitchenCommand("verify -t tests/integration") |
| 20 | } |
| 21 | |
| 22 | |
| 23 | def runKitchenCommand(cmd){ |
| 24 | sh "rbenv exec bundler exec kitchen ${cmd}" |
| 25 | } |
| 26 | |
| 27 | |
| 28 | |