Fixed using custom Gemfile in salt-formulas tests
Change-Id: Ie1bdca85e9b724c6fbef4f61b44c0669e251e47b
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index 2bf7b09..664b512 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -69,11 +69,18 @@
def kitchenConfigYML = readYaml(file: ".travis.yml")
kitchenEnvs=kitchenConfigYML["env"]
def kitchenInit = kitchenConfigYML["install"]
- for(int i=0;i<kitchenInit.size();i++){
- if(!kitchenInit[i].contains("pip install")){ //we dont want to execute pip install
- sh(kitchenInit[i])
+ def kitchenInstalled = false
+ if(kitchenInit && !kitchenInit.isEmpty()){
+ for(int i=0;i<kitchenInit.size();i++){
+ if(kitchenInit[i].trim().startsWith("test -e Gemfile")){ //found Gemfile config
+ ruby.installKitchen(kitchenInit[i].trim())
+ kitchenInstalled = true
+ }
}
}
+ if(!kitchenInstalled){
+ ruby.installKitchen()
+ }
}else{
common.infoMsg(".travis.yml not found, running default kitchen init")
ruby.installKitchen()