Changes in Jenkinsfile [fa234ef:245510f]
- File:
-
- 1 edited
-
Jenkinsfile (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
rfa234ef r245510f 5 5 //=========================================================================================================== 6 6 //Compilation script is done here but environnement set-up and error handling is done in main loop 7 def cfa_build( boolean full_build) {7 def cfa_build() { 8 8 build_stage 'Checkout' 9 9 def install_dir = pwd tmp: true 10 10 //checkout the source code and clean the repo 11 11 checkout scm 12 13 //Clean all temporary files to make sure no artifacts of the previous build remain14 12 sh 'git clean -fdqx' 15 16 //Reset the git repo so no local changes persist17 13 sh 'git reset --hard' 18 14 … … 30 26 build_stage 'Test' 31 27 32 //Run the tests from the testsdirectory28 //Run the tests from the example directory 33 29 dir ('src/tests') { 34 if (full_build) { 35 sh 'python test.py --all' 36 } 37 else { 38 sh './runTests.sh' 39 } 30 sh './runTests.sh' 40 31 } 41 32 … … 44 35 //do a maintainer-clean to make sure we need to remake from scratch 45 36 sh 'make maintainer-clean > /dev/null' 46 }47 48 def make_doc() {49 def err = null50 51 try {52 sh 'make clean > /dev/null'53 sh 'make > /dev/null 2>&1'54 }55 56 catch (Exception caughtError) {57 //rethrow error later58 err = caughtError59 60 sh 'cat *.log'61 }62 63 finally {64 /* Must re-throw exception to propagate error */65 if (err) {66 throw err67 }68 }69 }70 71 def doc_build() {72 stage 'Documentation'73 74 status_prefix = 'Documentation'75 76 dir ('doc/user') {77 make_doc()78 }79 80 dir ('doc/refrat') {81 make_doc()82 }83 37 } 84 38 … … 163 117 try { 164 118 //Prevent the build from exceeding 30 minutes 165 timeout( 60) {119 timeout(30) { 166 120 167 121 //Wrap build to add timestamp to command line … … 186 140 //Compile using gcc-4.9 187 141 currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9') 188 cfa_build( doPromoteBuild2DoLang)142 cfa_build() 189 143 190 144 //Compile using gcc-5 191 145 currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5') 192 cfa_build( doPromoteBuild2DoLang)146 cfa_build() 193 147 194 148 //Compile using gcc-4.9 195 149 currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6') 196 cfa_build(doPromoteBuild2DoLang) 197 198 //Compile latex documentation 199 doc_build() 150 cfa_build() 200 151 201 152 if( doPromoteBuild2DoLang ) { … … 234 185 //=========================================================================================================== 235 186 def notify_result(boolean promote, Exception err, String status, boolean log) { 236 echo 'Build completed, sending result notification'237 187 if(promote) { 238 188 if( err ) { … … 274 224 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 275 225 276 def gitLog = 'Error retrieving git logs' 277 def gitDiff = 'Error retrieving git diff' 278 279 try { 280 281 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 282 gitLog = readFile('GIT_LOG') 283 284 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 285 gitDiff = readFile('GIT_DIFF') 286 } 287 catch (Exception error) {} 226 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 227 def gitLog = readFile('GIT_LOG') 228 229 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 230 def gitDiff = readFile('GIT_DIFF') 288 231 289 232 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
Note:
See TracChangeset
for help on using the changeset viewer.