Deploy all the components at once in CICD jobs
Respect the mk-pipelines logic that expects the complete
list of components to select proper deployment steps.
Change-Id: I4ad62ea361b778e2bda8c255e01309590f833a61
diff --git a/jobs/pipelines/swarm-deploy-cicd.groovy b/jobs/pipelines/swarm-deploy-cicd.groovy
index 7d7fd63..b6f47ee 100644
--- a/jobs/pipelines/swarm-deploy-cicd.groovy
+++ b/jobs/pipelines/swarm-deploy-cicd.groovy
@@ -7,7 +7,8 @@
* PARENT_NODE_NAME Name of the jenkins slave to create the environment
* PARENT_WORKSPACE Path to the workspace of the parent job to use tcp-qa repo
* ENV_NAME Fuel-devops environment name
- * STACK_INSTALL Stacks to install using Jenkins on cfg01 node: "core:1800,cicd:1800", where 1800 is timeout
+ * STACK_INSTALL Stacks to install using Jenkins on cfg01 node: "core,cicd"
+ * STACK_INSTALL_TIMEOUT Stacks installation timeout
* TCP_QA_REFS Reference to the tcp-qa change on review.gerrithub.io, like refs/changes/46/418546/41
* SHUTDOWN_ENV_ON_TEARDOWN optional, shutdown fuel-devops environment at the end of the job
*
@@ -24,46 +25,44 @@
currentBuild.description = "${PARENT_NODE_NAME}:${ENV_NAME}"
-node ("${PARENT_NODE_NAME}") {
- if (! fileExists("${PARENT_WORKSPACE}")) {
- error "'PARENT_WORKSPACE' contains path to non-existing directory ${PARENT_WORKSPACE} on the node '${PARENT_NODE_NAME}'."
- }
- dir("${PARENT_WORKSPACE}") {
+def install_timeout = env.STACK_INSTALL_TIMEOUT.toInteger()
- if (! env.STACK_INSTALL) {
- error "'STACK_INSTALL' must contain one or more comma separated stack names for [deploy_openstack] pipeline"
+timeout(time: install_timeout + 600, unit: 'SECONDS') {
+
+ node ("${PARENT_NODE_NAME}") {
+ if (! fileExists("${PARENT_WORKSPACE}")) {
+ error "'PARENT_WORKSPACE' contains path to non-existing directory ${PARENT_WORKSPACE} on the node '${PARENT_NODE_NAME}'."
}
+ dir("${PARENT_WORKSPACE}") {
- if (env.TCP_QA_REFS) {
- stage("Update working dir to patch ${TCP_QA_REFS}") {
- shared.update_working_dir()
+ if (! env.STACK_INSTALL) {
+ error "'STACK_INSTALL' must contain one or more comma separated stack names for [deploy_openstack] pipeline"
}
- }
- // Install core and cicd
- def stack
- def timeout
-
- for (element in "${env.STACK_INSTALL}".split(",")) {
- if (element.contains(':')) {
- (stack, timeout) = element.split(':')
- } else {
- stack = element
- timeout = '1800'
+ if (env.TCP_QA_REFS) {
+ stage("Update working dir to patch ${TCP_QA_REFS}") {
+ shared.update_working_dir()
+ }
}
try {
- stage("Run Jenkins job on salt-master [deploy_openstack:${stack}]") {
- shared.run_job_on_day01_node(stack, timeout)
+ // Install core and cicd
+ stage("Run Jenkins job on salt-master [deploy_openstack:drivetrain]") {
+ shared.run_job_on_day01_node(env.STACK_INSTALL, install_timeout)
}
- stage("Sanity check the deployed component [${stack}]") {
- shared.sanity_check_component(stack)
- }
+ for (stack in "${env.STACK_INSTALL}".split(",")) {
+ stage("Sanity check the deployed component [${stack}]") {
+ shared.sanity_check_component(stack)
+ }
+ stage("Make environment snapshot [${stack}_deployed]") {
+ shared.devops_snapshot(stack)
+ }
+ } // for
} catch (e) {
common.printMsg("Job is failed", "purple")
- shared.download_logs("deploy_${stack}")
+ shared.download_logs("deploy_drivetrain")
throw e
} finally {
// TODO(ddmitriev): analyze the "def currentResult = currentBuild.result ?: 'SUCCESS'"
@@ -76,10 +75,6 @@
}
}
- stage("Make environment snapshot [${stack}_deployed]") {
- shared.devops_snapshot(stack)
- }
-
- } // for
- } // dir
-} // node
+ } // dir
+ } // node
+}
\ No newline at end of file