From b39bf79bab4ccc46ab432cfa668a6190643da4cc Mon Sep 17 00:00:00 2001
From: Raphael Defosseux <raphael.defosseux@eurecom.fr>
Date: Tue, 2 Apr 2019 18:38:27 +0200
Subject: [PATCH] CI: pipeline is too big

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
---
 ci-scripts/Jenkinsfile-gitlab | 164 +---------------------------------
 1 file changed, 3 insertions(+), 161 deletions(-)

diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab
index 8bd6a107c0a..d0446f0ec08 100644
--- a/ci-scripts/Jenkinsfile-gitlab
+++ b/ci-scripts/Jenkinsfile-gitlab
@@ -36,21 +36,6 @@ def doFlexranCtrlTest = false
 // Location of the executor node
 def nodeExecutor = params.nodeExecutor
 
-// Stage Pass Statuses
-def build_enb_usrp = false
-def build_basic_sim = false
-def build_phy_sim = false
-def build_enb_ethernet = false
-def build_ue_ethernet = false
-def test_basic_sim = false
-def test_phy_sim = false
-def test_l2_sim = false
-def test_fdd_mono_band7 = false
-def test_fdd_mono_band13 = false
-def test_tdd_mono_band40 = false
-def test_fdd_if4p5_band7 = false
-def test_tdd_if4p5_band40 = false
-
 pipeline {
     agent {
         label nodeExecutor
@@ -236,13 +221,6 @@ pipeline {
                             }
                         }
                     }
-                    post {
-                        success {
-                            script {
-                                build_enb_usrp = true
-                            }
-                        }
-                    }
                 }
                 stage ("Build basic simulator") {
                     steps {
@@ -252,13 +230,6 @@ pipeline {
                             }
                         }
                     }
-                    post {
-                        success {
-                            script {
-                                build_basic_sim = true
-                            }
-                        }
-                    }
                 }
                 stage ("Build eNb-ethernet") {
                     steps {
@@ -268,13 +239,6 @@ pipeline {
                             }
                         }
                     }
-                    post {
-                        success {
-                            script {
-                                build_enb_ethernet = true
-                            }
-                        }
-                    }
                 }
                 stage ("Build UE-ethernet") {
                     steps {
@@ -284,13 +248,6 @@ pipeline {
                             }
                         }
                     }
-                    post {
-                        success {
-                            script {
-                                build_ue_ethernet = true
-                            }
-                        }
-                    }
                 }
                 stage ("Build L2-Simulator-eNB") {
                     steps {
@@ -309,13 +266,6 @@ pipeline {
                             }
                         }
                     }
-                    post {
-                        success {
-                            script {
-                                build_phy_sim = true
-                            }
-                        }
-                    }
                 }
                 stage ("Build eNb-USRP on Red Hat") {
                     when {
@@ -406,13 +356,6 @@ pipeline {
                                     }
                                 }
                             }
-                            post {
-                                success {
-                                    script {
-                                        test_phy_sim = true
-                                    }
-                                }
-                            }
                         }
                         stage ("Build Flexran Controller") {
                             when {
@@ -444,13 +387,6 @@ pipeline {
                                     }
                                 }
                             }
-                            post {
-                                success {
-                                    script {
-                                        test_basic_sim = true
-                                    }
-                                }
-                            }
                         }
                         stage ("Test L2 simulator") {
                             steps {
@@ -466,13 +402,6 @@ pipeline {
                                     }
                                 }
                             }
-                            post {
-                                success {
-                                    script {
-                                        test_l2_sim = true
-                                    }
-                                }
-                            }
                         }
                     }
                 }
@@ -504,11 +433,6 @@ pipeline {
                         }
                     }
                     post {
-                        success {
-                            script {
-                                test_fdd_mono_band7 = true
-                            }
-                        }
                         // In case of any non-success, we are retrieving the HTML report of the last completed
                         // slave job. The only drop-back is that we may retrieve the HTML report of a previous build
                         always {
@@ -559,11 +483,6 @@ pipeline {
                         }
                     }
                     post {
-                        success {
-                            script {
-                                test_tdd_mono_band40 = true
-                            }
-                        }
                         // In case of any non-success, we are retrieving the HTML report of the last completed
                         // slave job. The only drop-back is that we may retrieve the HTML report of a previous build
                         always {
@@ -614,11 +533,6 @@ pipeline {
                         }
                     }
                     post {
-                        success {
-                            script {
-                                test_fdd_if4p5_band7 = true
-                            }
-                        }
                         // In case of any non-success, we are retrieving the HTML report of the last completed
                         // slave job.  The only drop-back is that we may retrieve the HTML report of a previous build
                         always {
@@ -669,11 +583,6 @@ pipeline {
                         }
                     }
                     post {
-                        success {
-                            script {
-                                test_tdd_if4p5_band40 = true
-                            }
-                        }
                         // In case of any non-success, we are retrieving the HTML report of the last completed
                         // slave job. The only drop-back is that we may retrieve the HTML report of a previous build
                         always {
@@ -724,11 +633,6 @@ pipeline {
                         }
                     }
                     post {
-                        success {
-                            script {
-                                test_fdd_mono_band13 = true
-                            }
-                        }
                         // In case of any non-success, we are retrieving the HTML report of the last completed
                         // slave job. The only drop-back is that we may retrieve the HTML report of a previous build
                         always {
@@ -835,75 +739,13 @@ pipeline {
             script {
                 // Stage destroy may not be run if error in previous stage
                 sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
-                def bodyMsg = '''Hi,
-
-'''
-                if ((!build_enb_usrp) || (!build_basic_sim) || (!build_phy_sim) || (!build_enb_ethernet) || (!build_ue_ethernet) ||
-                    (!test_basic_sim) || (!test_phy_sim) || (!test_l2_sim) ||
-                    (!test_fdd_mono_band7) || (!test_fdd_mono_band13) || (!test_tdd_mono_band40) || (!test_fdd_if4p5_band7) || (!test_tdd_if4p5_band40)) {
-                    bodyMsg +=  '''Stages that did fail:
-'''
-                }
-                if (!build_enb_usrp) {
-                    bodyMsg +=  '''  -- Build eNB + USRP stage
-'''
-                }
-                if (!build_basic_sim) {
-                    bodyMsg +=  '''  -- Build Basic-Simulator stage
-'''
-                }
-                if (!build_phy_sim) {
-                    bodyMsg +=  '''  -- Build Physical-Simulators stage
-'''
-                }
-                if (!build_enb_ethernet) {
-                    bodyMsg +=  '''  -- Build eNB + ETHERNET transport stage
-'''
-                }
-                if (!build_ue_ethernet) {
-                    bodyMsg +=  '''  -- Build UE + ETHERNET transport stage
-'''
-                }
-                if (!test_basic_sim) {
-                    bodyMsg +=  '''  -- Test Basic-Simulator stage
-'''
-                }
-                if (!test_phy_sim) {
-                    bodyMsg +=  '''  -- Test Physical-Simulators stage
-'''
-                }
-                if (!test_l2_sim) {
-                    bodyMsg +=  '''  -- Test L2-nFAPI-Simulator stage
-'''
-                }
-                if (!test_fdd_mono_band7) {
-                    bodyMsg +=  '''  -- Test B210-FDD-Monolithic-Band7 stage
-'''
-                }
-                if (!test_fdd_mono_band13) {
-                    bodyMsg +=  '''  -- Test B210-FDD-Monolithic-Band13 stage
-'''
-                }
-                if (!test_tdd_mono_band40) {
-                    bodyMsg +=  '''  -- Test B210-TDD-Monolithic-Band40 stage
-'''
-                }
-                if (!test_fdd_if4p5_band7) {
-                    bodyMsg +=  '''  -- Test B210-FDD-IF4.5-Band7 stage
-'''
-                }
-                if (!test_tdd_if4p5_band40) {
-                    bodyMsg +=  '''  -- Test B210-TDD-IF4.5-Band40 stage
-'''
-                }
-               bodyMsg += '''
+                emailext attachmentsPattern: '*results*.html',
+                     body: '''Hi,
 
 Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
 
 Regards,
-OAI CI Team'''
-                emailext attachmentsPattern: '*results*.html',
-                     body: bodyMsg,
+OAI CI Team''',
                      replyTo: 'no-reply@openairinterface.org',
                      subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!',
                      to: gitCommitAuthorEmailAddr
-- 
GitLab