Move rebooting HW node before the booting cfg node

MOSSUST-109

Change-Id: Ic9c27851098837ee1be45d108fdec9e2489b2b97
diff --git a/jobs/pipelines/deploy-cicd-and-run-tests.groovy b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
index 10536c7..24f65a7 100644
--- a/jobs/pipelines/deploy-cicd-and-run-tests.groovy
+++ b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
@@ -131,11 +131,24 @@
   node ("${NODE_NAME}") {
     env.slave_workdir = pwd()
     try {
+        if (env.IPMI_CREDS) {
+            withCredentials([
+               [$class          : 'UsernamePasswordMultiBinding',
+               credentialsId   : "${IPMI_CREDS}",
+               passwordVariable: 'IPMI_PASS',
+               usernameVariable: 'IPMI_USER']
+                ]) {
+                env.IPMI_PASS = IPMI_PASS
+                env.IPMI_USER = IPMI_USER
+                shared.reboot_hardware_nodes("${IPMI_CREDS}")
+            }
+        }
 
         // run deploy stages
         deploy(shared, common, steps, env_manager, batch_size, dist_upgrade_nodes, upgrade_saltstack)
         // run test stages
         test(shared, common, steps, env_manager)
+
     } catch (e) {
         common.printMsg("Job is failed: " + e.message, "purple")
         throw e