Drop Travis CI support
- Until all formulas are switched to new config
keep backwards compatibility
- Once all formulas are switched to new config
old approach will be deprecated
Fixes: PROD-25037 (PROD:25037)
Change-Id: I262fa36b41ac6ad77512d58dcc45f04640e61f33
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index 434654c..45eeef8 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -132,6 +132,7 @@
}
stage("kitchen") {
+ if (fileExists(".travis.yml")) {/** TODO: Remove this legacy block once formulas are switched to new configuration */
if (checkouted) {
if (fileExists(".kitchen.yml") || fileExists(".kitchen.openstack.yml")) {
if (fileExists(".kitchen.openstack.yml")) {
@@ -169,6 +170,47 @@
common.warningMsg(".kitchen.yml file not found, no kitchen tests triggered.")
}
}
+ }/** TODO: End of block for removal */
+ } else {
+ if (checkouted) {
+ if (fileExists(".kitchen.yml") || fileExists(".kitchen.openstack.yml")) {
+ if (fileExists(".kitchen.openstack.yml")) {
+ common.infoMsg("Openstack Kitchen test configuration found, running Openstack kitchen tests.")
+ if (fileExists(".kitchen.yml")) {
+ common.infoMsg("Ignoring the docker Kitchen test configuration file.")
+ }
+ } else {
+ common.infoMsg("Docker Kitchen test configuration found, running Docker kitchen tests.")
+ }
+ def kitchenEnvs = []
+ ruby.ensureRubyEnv()
+ if (!fileExists("Gemfile")) {
+ sh("curl -s -o ./Gemfile 'https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas/salt-formulas-scripts.git;a=blob_plain;f=Gemfile;hb=refs/heads/master'")
+ ruby.installKitchen()
+ } else {
+ common.infoMsg("Override Gemfile found in the kitchen directory, using it.")
+ ruby.installKitchen()
+ }
+ common.infoMsg = ruby.runKitchenCommand("list -b")
+ kitchenEnvs = ruby.runKitchenCommand("list -b").split()
+ common.infoMsg(kitchenEnvs)
+ common.infoMsg("Running kitchen testing in parallel mode")
+ if (CUSTOM_KITCHEN_ENVS != null && CUSTOM_KITCHEN_ENVS != '') {
+ kitchenEnvs = CUSTOM_KITCHEN_ENVS.tokenize('\n')
+ common.infoMsg("CUSTOM_KITCHEN_ENVS not empty. Running with custom enviroments: ${kitchenEnvs}")
+ }
+ if (kitchenEnvs != null && kitchenEnvs != '') {
+ def acc = 0
+ common.infoMsg("Found " + kitchenEnvs.size() + " environment(s)")
+ for (int i = 0; i < kitchenEnvs.size(); i++) {
+ futureFormulas << kitchenEnvs[i]
+ }
+ setupRunner(defaultGitRef, defaultGitUrl)
+ } else {
+ common.warningMsg(".kitchen.yml nor .kitchen.openstack.yml file not found, no kitchen tests triggered.")
+ }
+ }
+ }
}
}
if (failedFormulas) {