Changes in Jenkins/FullBuild [14ce3392:5a11e07]
- File:
-
- 1 edited
-
Jenkins/FullBuild (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
r14ce3392 r5a11e07 1 1 #!groovy 2 2 3 //===========================================================================================================4 // Main loop of the compilation5 //===========================================================================================================6 7 node ('master') {8 def err = null9 10 try {11 //Prevent the build from exceeding 30 minutes12 timeout(60) {13 14 //Wrap build to add timestamp to command line15 wrap([$class: 'TimestamperBuildWrapper']) {16 17 stage 'Build'18 19 results = [null, null]20 21 parallel (22 gcc_6_x64: { trigger_build( 'gcc-6', 'x64' ) },23 gcc_6_x86: { trigger_build( 'gcc-6', 'x86' ) },24 gcc_5_x64: { trigger_build( 'gcc-5', 'x64' ) },25 gcc_5_x86: { trigger_build( 'gcc-5', 'x86' ) },26 gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64' ) },27 gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86' ) },28 clang_x64: { trigger_build( 'clang', 'x64' ) },29 clang_x86: { trigger_build( 'clang', 'x86' ) },30 )31 32 //Push latest changes to do-lang repo33 push_build()34 }35 }36 }37 38 //If an exception is caught we need to change the status and remember to39 //attach the build log to the email40 catch (Exception caughtError) {41 echo('error caught')42 43 //rethrow error later44 err = caughtError45 46 //Store the result of the build log47 currentBuild.result = 'FAILURE'48 49 //Send email to notify the failure50 promote_failure_email()51 }52 53 finally {54 //Must re-throw exception to propagate error55 if (err) {56 throw err57 }58 }59 }60 3 //=========================================================================================================== 61 4 // Main compilation routines 62 5 //=========================================================================================================== 63 6 64 def trigger_build(String cc, Stringarch) {7 def trigger_build(String arch) { 65 8 def result = build job: 'Cforall/master', \ 66 9 parameters: [ \ 10 [$class: 'BooleanParameterValue', \ 11 name: 'isFullBuild', \ 12 value: true], \ 67 13 [$class: 'StringParameterValue', \ 68 name: 'pCompiler', \ 69 value: cc], \ 70 [$class: 'StringParameterValue', \ 71 name: 'pArchitecture', \ 72 value: arch], \ 73 [$class: 'BooleanParameterValue', \ 74 name: 'pRunAllTests', \ 75 value: true], \ 76 [$class: 'BooleanParameterValue', \ 77 name: 'pRunBenchmark', \ 78 value: true], \ 79 [$class: 'BooleanParameterValue', \ 80 name: 'pBuildDocumentation', \ 81 value: true], \ 82 [$class: 'BooleanParameterValue', \ 83 name: 'pPublish', \ 84 value: true], \ 85 [$class: 'BooleanParameterValue', \ 86 name: 'pSilent', \ 87 value: true], \ 14 name: 'buildArchitecture', \ 15 value: arch] \ 88 16 ], \ 89 17 propagate: false … … 141 69 142 70 //=========================================================================================================== 71 // Main loop of the compilation 72 //=========================================================================================================== 73 74 node ('master') { 75 def err = null 76 77 try { 78 //Prevent the build from exceeding 30 minutes 79 timeout(60) { 80 81 //Wrap build to add timestamp to command line 82 wrap([$class: 'TimestamperBuildWrapper']) { 83 84 stage 'Build' 85 86 results = [null, null] 87 88 parallel ( 89 x64: { 90 trigger_build('64-bit') 91 }, 92 x32: { 93 trigger_build('32-bit') 94 } 95 ) 96 97 //Push latest changes to do-lang repo 98 push_build() 99 } 100 } 101 } 102 103 //If an exception is caught we need to change the status and remember to 104 //attach the build log to the email 105 catch (Exception caughtError) { 106 echo('error caught') 107 108 //rethrow error later 109 err = caughtError 110 111 //Store the result of the build log 112 currentBuild.result = 'FAILURE' 113 114 //Send email to notify the failure 115 promote_failure_email() 116 } 117 118 finally { 119 //Must re-throw exception to propagate error 120 if (err) { 121 throw err 122 } 123 } 124 } 125 //=========================================================================================================== 143 126 //Routine responsible of sending the email notification once the build is completed 144 127 //===========================================================================================================
Note:
See TracChangeset
for help on using the changeset viewer.