Stop using serial
Change-Id: I0e8c9316d51677a7ac02509d0f84a0915595bca5
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index b984d53..42e4cb4 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -4,8 +4,8 @@
python = new com.mirantis.mk.Python()
saltModelTesting = new com.mirantis.mk.SaltModelTesting()
-def generateSaltMaster(modelEnv, clusterDomain, clusterName) {
- def nodeFile = "${modelEnv}/nodes/cfg01.${clusterDomain}.yml"
+def generateSaltMaster(modEnv, clusterDomain, clusterName) {
+ def nodeFile = "${modEnv}/nodes/cfg01.${clusterDomain}.yml"
def nodeString = """classes:
- cluster.${clusterName}.infra.config
parameters:
@@ -17,17 +17,18 @@
name: cfg01
domain: ${clusterDomain}
"""
- sh "mkdir -p ${modelEnv}/nodes/"
+ sh "mkdir -p ${modEnv}/nodes/"
+ println "Create file ${nodeFile}"
writeFile(file: nodeFile, text: nodeString)
}
-def generateModel(contextFile, cutterEnv) {
+def generateModel(modelFile, cutterEnv) {
def templateEnv = "${env.WORKSPACE}"
def modelEnv = "${env.WORKSPACE}/model"
- def basename = sh(script: "basename ${contextFile} .yml", returnStdout: true).trim()
+ def basename = sh(script: "basename ${modelFile} .yml", returnStdout: true).trim()
def generatedModel = "${modelEnv}/${basename}"
def testEnv = "${env.WORKSPACE}/test"
- def content = readFile(file: "${templateEnv}/contexts/${contextFile}")
+ def content = readFile(file: "${templateEnv}/contexts/${modelFile}")
def templateContext = readYaml text: content
def clusterDomain = templateContext.default_context.cluster_domain
def clusterName = templateContext.default_context.cluster_name
@@ -38,28 +39,26 @@
def templateOutputDir = templateBaseDir
sh "rm -rf ${generatedModel} || true"
- stage("Generate model from ${contextFile}") {
- def productList = ["infra", "cicd", "opencontrail", "kubernetes", "openstack", "stacklight"]
- for (product in productList) {
- def stagename = (product == "infra") ? "Generate base infrastructure" : "Generate product ${product}"
- if (product == "infra" || (templateContext.default_context["${product}_enabled"]
- && templateContext.default_context["${product}_enabled"].toBoolean())) {
- templateDir = "${templateEnv}/cluster_product/${product}"
- templateOutputDir = "${env.WORKSPACE}/output/${product}"
- sh "rm -rf ${templateOutputDir} || true"
- sh "mkdir -p ${templateOutputDir}"
- sh "mkdir -p ${outputDestination}"
- python.buildCookiecutterTemplate(templateDir, content, templateOutputDir, cutterEnv, templateBaseDir)
- sh "mv -v ${templateOutputDir}/${clusterName}/* ${outputDestination}"
- }
+ def productList = ["infra", "cicd", "opencontrail", "kubernetes", "openstack", "stacklight"]
+ for (product in productList) {
+ def stagename = (product == "infra") ? "Generate base infrastructure" : "Generate product ${product}"
+ if (product == "infra" || (templateContext.default_context["${product}_enabled"]
+ && templateContext.default_context["${product}_enabled"].toBoolean())) {
+ templateDir = "${templateEnv}/cluster_product/${product}"
+ templateOutputDir = "${env.WORKSPACE}/output/${product}"
+ sh "rm -rf ${templateOutputDir} || true"
+ sh "mkdir -p ${templateOutputDir}"
+ sh "mkdir -p ${outputDestination}"
+ python.buildCookiecutterTemplate(templateDir, content, templateOutputDir, cutterEnv, templateBaseDir)
+ sh "mv -v ${templateOutputDir}/${clusterName}/* ${outputDestination}"
}
- generateSaltMaster(generatedModel, clusterDomain, clusterName)
}
+ generateSaltMaster(generatedModel, clusterDomain, clusterName)
}
-def testModel(contextFile, testEnv) {
+def testModel(modelFile, testEnv) {
def templateEnv = "${env.WORKSPACE}"
- def content = readFile(file: "${templateEnv}/contexts/${contextFile}.yml")
+ def content = readFile(file: "${templateEnv}/contexts/${modelFile}.yml")
def templateContext = readYaml text: content
def clusterDomain = templateContext.default_context.cluster_domain
git.checkoutGitRepository("${testEnv}/classes/system", RECLASS_MODEL_URL, RECLASS_MODEL_BRANCH, CREDENTIALS_ID)
@@ -111,18 +110,17 @@
def contextFileList = []
for (int i = 0; i < contextFiles.size(); i++) {
- //generateModel(contextFiles[i], cutterEnv)
contextFileList << contextFiles[i]
}
stage("generate-model") {
- def buildSteps = [:]
for (contextFile in contextFileList) {
- buildSteps[contextFile] = { generateModel(contextFile, cutterEnv) }
+ generateModel(contextFile, cutterEnv)
}
- common.serial(buildSteps)
}
+ sh("ls -lRa")
+
stage("test-nodes") {
def partitions = common.partitionList(contextFileList, 3)
def buildSteps = [:]