diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 40f0e98536bdb7850208c0eba9e5fe35d9dfd9d3..7a7cdbe3627e6a93dd0bce08a617c17cd1dc2f7b 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -152,6 +152,7 @@ def pre_test_mac() { ''' return 1 } + pipeline { agent {label " dispatcher "} options { skipDefaultCheckout() } @@ -161,222 +162,5 @@ pipeline { LOGDIR = '/var/data/jenkins/workspace/log' } stages { - stage ('pre_build') { - steps { - sh ''' - date - pwd - env - hostname - ''' - } - } - stage ('build docs') { - when { - allOf { - expression { env.CHANGE_BRANCH =~ /docs\// } - } - } - agent {label "docusaurus"} - steps { - timeout(time: 5, unit: 'MINUTES') { - sync_source() - script { - sh ''' - echo hello - ''' - } - } - } - } - stage ('Parallel build stage') { - //only build pr - options { skipDefaultCheckout() } - when { - allOf { - 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 { - allOf { - not { expression { env.CHANGE_BRANCH =~ /docs\// }} - } - } - parallel { - stage ('build worker07_arm64') { - agent {label " worker07_arm64 "} - steps { - timeout(time: 20, unit: 'MINUTES') { - pre_test() - script { - sh ''' - echo "worker07_arm64 build done" - date - ''' - } - } - } - } - stage ('build Mac_catalina ') { - agent {label " Mac_catalina "} - steps { - timeout(time: 20, unit: 'MINUTES') { - pre_test_mac() - script { - sh ''' - echo "Mac_catalina build done" - date - ''' - } - } - } - } - stage('run cases') { - steps { - sh ''' - date - hostname - ''' - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - timeout(time: 20, unit: 'MINUTES') { - sh ''' - date - cd ${WKC}/tests/parallel_test - time ./run.sh -m m.json -t cases.task -l ${LOGDIR} -b ${BRANCH_NAME} - date - hostname - ''' - } - } - } - } - } - } - } - post { - success { - emailext ( - subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS", - body: """ - - - - - - - - - - - - -
-
- 构建信息 -
-
-
    -
    -
  • 构建名称>>分支:${env.BRANCH_NAME}
  • -
  • 构建结果: Successful
  • -
  • 构建编号:${BUILD_NUMBER}
  • -
  • 触发用户:${env.CHANGE_AUTHOR}
  • -
  • 提交信息:${env.CHANGE_TITLE}
  • -
  • 构建地址:${BUILD_URL}
  • -
  • 构建日志:${BUILD_URL}console
  • -
    -
-
- - """, - to: "${env.CHANGE_AUTHOR_EMAIL}", - from: "support@taosdata.com" - ) - } - failure { - emailext ( - subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' FAIL", - body: """ - - - - - - - - - - - - -
-
- 构建信息 -
-
-
    -
    -
  • 构建名称>>分支:${env.BRANCH_NAME}
  • -
  • 构建结果: Failure
  • -
  • 构建编号:${BUILD_NUMBER}
  • -
  • 触发用户:${env.CHANGE_AUTHOR}
  • -
  • 提交信息:${env.CHANGE_TITLE}
  • -
  • 构建地址:${BUILD_URL}
  • -
  • 构建日志:${BUILD_URL}console
  • -
    -
-
- - """, - to: "${env.CHANGE_AUTHOR_EMAIL}", - from: "support@taosdata.com" - ) - } } }