Changeset 6003581
- Timestamp:
- Jul 12, 2016, 3:49:01 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ccd5b12
- Parents:
- 1b8c156
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
r1b8c156 r6003581 1 1 #!groovy 2 2 3 3 //=========================================================================================================== 4 // Main compilation routines 5 //=========================================================================================================== 4 6 def push_build() { 5 7 //Don't use the build_stage function which outputs the compiler … … 23 25 } 24 26 27 //=========================================================================================================== 28 // Main loop of the compilation 29 //=========================================================================================================== 30 node ('master'){ 31 try { 32 //Prevent the build from exceeding 30 minutes 33 timeout(60) { 34 35 //Wrap build to add timestamp to command line 36 wrap([$class: 'TimestamperBuildWrapper']) { 37 38 build job: 'Cforall/master', \ 39 parameters: [ \ 40 [$class: 'BooleanParameterValue', \ 41 name: 'isFullBuild', \ 42 value: true], \ 43 [$class: 'StringParameterValue', \ 44 name: 'buildArchitecture', \ 45 value: '64-bit'] \ 46 ] 47 48 //Push latest changes to do-lang repo 49 //push_build() 50 } 51 } 52 } 53 54 //If an exception is caught we need to change the status and remember to 55 //attach the build log to the email 56 catch (Exception caughtError) { 57 //rethrow error later 58 err = caughtError 59 60 //Store the result of the build log 61 currentBuild.result = "${status_prefix} FAILURE".trim() 62 63 //Send email to notify the failure 64 //promote_email(currentBuild.result) 65 } 66 67 finally { 68 //Must re-throw exception to propagate error 69 if (err) { 70 throw err 71 } 72 } 73 } 74 75 //=========================================================================================================== 76 //Routine responsible of sending the email notification once the build is completed 77 //=========================================================================================================== 25 78 26 79 //Email notification on a full build failure -
Jenkinsfile
r1b8c156 r6003581 2 2 3 3 //=========================================================================================================== 4 // Main compilation routine 4 // Main compilation routines 5 5 //=========================================================================================================== 6 6 //Compilation script is done here but environnement set-up and error handling is done in main loop … … 83 83 } 84 84 85 def push_build() {86 //Don't use the build_stage function which outputs the compiler87 stage 'Push'88 89 status_prefix = 'Push'90 91 def out_dir = pwd tmp: true92 sh "mkdir -p ${out_dir}"93 94 //parse git logs to find what changed95 sh "git remote > ${out_dir}/GIT_REMOTE"96 git_remote = readFile("${out_dir}/GIT_REMOTE")97 remoteDoLangExists = git_remote.contains("DoLang")98 99 if( !remoteDoLangExists ) {100 sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'101 }102 103 sh "git push DoLang ${gitRefNewValue}:master"104 }105 106 85 //=========================================================================================================== 107 86 // Helper classes/variables/routines to make the status and stage name easier to use … … 155 134 node ('master'){ 156 135 157 boolean do PromoteBuild2DoLang136 boolean doFullBuild 158 137 def err = null 159 138 def log_needed = false … … 176 155 defaultValue: false, \ 177 156 description: 'If true, the build will be promoted to the do-lang git repository (on successful builds only)', \ 178 name: ' promoteBuild2DoLang' \157 name: 'isFullBuild' \ 179 158 ], \ 180 159 [$class: 'ChoiceParameterDefinition', \ … … 186 165 ]]) 187 166 188 do PromoteBuild2DoLang = promoteBuild2DoLang== 'true'167 doFullBuild = isFullBuild == 'true' 189 168 architectureFlag = buildArchitecture == '64-bit' ? '-m64' : (buildArchitecture == '32-bit' ? '-m32' : 'ERROR') 190 169 … … 193 172 //Compile using gcc-4.9 194 173 currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9') 195 cfa_build(do PromoteBuild2DoLang, architectureFlag)174 cfa_build(doFullBuild, architectureFlag) 196 175 197 176 //Compile latex documentation 198 177 doc_build() 199 178 200 if( do PromoteBuild2DoLang) {179 if( doFullBuild ) { 201 180 //Compile using gcc-5 202 181 currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5') … … 206 185 currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6') 207 186 cfa_build(true, architectureFlag) 208 209 //Push latest changes to do-lang repo210 push_build()211 187 } 212 188 } … … 251 227 email(status, log) 252 228 } 253 }254 255 //Email notification on a full build failure256 def promote_email(String status) {257 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line258 //Configurations for email format259 def email_subject = "[cforall git][PROMOTE - FAILURE]"260 def email_body = """This is an automated email from the Jenkins build machine. It was261 generated because of a git hooks/post-receive script following262 a ref change was pushed to the repository containing263 the project "UNNAMED PROJECT".264 265 Check console output at ${env.BUILD_URL} to view the results.266 267 - Status --------------------------------------------------------------268 269 PROMOTE FAILURE - ${status}270 """271 272 def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com"273 274 //send email notification275 emailext body: email_body, subject: email_subject, to: email_to, attachLog: true276 229 } 277 230
Note: See TracChangeset
for help on using the changeset viewer.