From fa4cdb3a6995819aaa77276c9f92b8a06a351a9e Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Mon, 20 Jun 2022 11:50:16 +0800 Subject: [PATCH] enh: split the ci environment into two --- Jenkinsfile2 | 78 ++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 61 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index f213afe3b9..54e203a802 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -155,7 +155,6 @@ def pre_test_mac() { return 1 } pipeline { - agent {label " dispatcher "} options { skipDefaultCheckout() } environment{ WK = '/var/data/jenkins/workspace/TDinternal' @@ -173,59 +172,6 @@ pipeline { ''' } } - stage ('Parallel build stage') { - //only build pr - options { skipDefaultCheckout() } - when { - allOf { - changeRequest() - not { expression { env.CHANGE_BRANCH =~ /docs\// }} - } - } - parallel { - stage ('dispatcher sync source') { - steps { - timeout(time: 20, unit: 'MINUTES') { - sync_source() - script { - sh ''' - echo "dispatcher ready" - date - ''' - } - } - } - } - stage ('build worker01') { - agent {label " worker01 "} - steps { - timeout(time: 20, unit: 'MINUTES') { - pre_test() - script { - sh ''' - echo "worker01 build done" - date - ''' - } - } - } - } - stage ('build worker02') { - agent {label " worker02 "} - steps { - timeout(time: 20, unit: 'MINUTES') { - pre_test() - script { - sh ''' - echo "worker02 build done" - date - ''' - } - } - } - } - } - } stage('run test') { options { skipDefaultCheckout() } when { @@ -235,28 +181,28 @@ pipeline { } } parallel { - stage ('build worker07_arm64') { - agent {label " worker07_arm64 "} + stage ('build arm64') { + agent {label " worker07_arm64 || worker09_arm64 "} steps { timeout(time: 20, unit: 'MINUTES') { pre_test() script { sh ''' - echo "worker07_arm64 build done" + echo "arm64 build done" date ''' } } } } - stage ('build Mac_catalina ') { + stage ('build Mac') { agent {label " Mac_catalina "} steps { timeout(time: 20, unit: 'MINUTES') { pre_test_mac() script { sh ''' - echo "Mac_catalina build done" + echo "Mac build done" date ''' } @@ -264,17 +210,27 @@ pipeline { } } stage('run cases') { + agent {label " worker01 || worker02 "} steps { sh ''' date hostname ''' + timeout(time: 15, unit: 'MINUTES') { + pre_test() + script { + sh ''' + echo "Linux build done" + date + ''' + } + } catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - timeout(time: 20, unit: 'MINUTES') { + timeout(time: 25, unit: 'MINUTES') { sh ''' date cd ${WKC}/tests/parallel_test - time ./run.sh -m m.json -t cases.task -l ${LOGDIR} -b ${BRANCH_NAME} + time ./run.sh -m /home/m.json -t cases.task -l ${LOGDIR} -b ${BRANCH_NAME} date hostname ''' -- GitLab