Report results in proper order

Closes-Bug: #PROD-30631
Change-Id: Ia9083256dbb4c2d94100fecf2b1019768f2ec396
diff --git a/jobs/pipelines/deploy-cicd-and-run-tests.groovy b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
index 567ddc6..bf447eb 100644
--- a/jobs/pipelines/deploy-cicd-and-run-tests.groovy
+++ b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
@@ -38,6 +38,11 @@
             } else {
                 throw new Exception("Unknow env_manager: '${env_manager}'")
             }
+
+            if (fileExists("jenkins_agent_description.txt")) {
+                def String jenkins_agent_description = readFile("jenkins_agent_description.txt")
+                currentBuild.description += "${jenkins_agent_description}"
+            }
         }
 
         stage("Install core infrastructure and deploy CICD nodes") {
@@ -135,36 +140,10 @@
             }
         }
 
-        if (fileExists("jenkins_agent_description.txt")) {
-            def String jenkins_agent_description = readFile("jenkins_agent_description.txt")
-            currentBuild.description += "${jenkins_agent_description}"
-
-            // if there is a separated foundation node on $jenkins_slave_node_name,
-            // then archive artifacts also on that node
-            if (jenkins_slave_node_name != env.NODE_NAME) {
-                node ("${jenkins_slave_node_name}") {
-                    stage("Archive all xml reports from node ${jenkins_slave_node_name}") {
-                        archiveArtifacts artifacts: "**/*.xml,**/*.ini,**/*.log,**/*.tar.gz"
-                    }
-                    if ("${env.REPORT_TO_TESTRAIL}" != "false") {
-                        stage("report results to testrail") {
-                            common.printMsg("Running on: " + node_with_reports, "blue")
-                            shared.swarm_testrail_report(steps, node_with_reports)
-                    }
-                        stage("Store TestRail reports to job description from ${jenkins_slave_node_name}") {
-                            if (fileExists("description.txt")) {
-                                def String description  = readFile("description.txt")
-                                currentBuild.description += "${description}"
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
         stage("Archive all xml reports") {
             archiveArtifacts artifacts: "**/*.xml,**/*.ini,**/*.log,**/*.tar.gz"
         }
+
         if ("${env.REPORT_TO_TESTRAIL}" != "false") {
             stage("report results to testrail from jenkins master") {
                 common.printMsg("Running on: " + node_with_reports, "blue")
@@ -182,6 +161,31 @@
                 }
             }
         }
+
+        if (fileExists("jenkins_agent_description.txt")) {
+            // if there is a separated foundation node on $jenkins_slave_node_name,
+            // then archive artifacts also on that node
+            if (jenkins_slave_node_name != env.NODE_NAME) {
+                node ("${jenkins_slave_node_name}") {
+                    stage("Archive all xml reports from node ${jenkins_slave_node_name}") {
+                        archiveArtifacts artifacts: "**/*.xml,**/*.ini,**/*.log,**/*.tar.gz"
+                    }
+                    if ("${env.REPORT_TO_TESTRAIL}" != "false") {
+                        stage("report results to testrail") {
+                            common.printMsg("Running on: " + node_with_reports, "blue")
+                            shared.swarm_testrail_report(steps, node_with_reports)
+                        }
+                        stage("Store TestRail reports to job description from ${jenkins_slave_node_name}") {
+                            if (fileExists("description.txt")) {
+                                def String description  = readFile("description.txt")
+                                currentBuild.description += "${description}"
+                            }
+                        }
+                    }
+                } // node
+            }
+        }
+
     } // try
   } // node