Changes in Jenkinsfile [30e32b2:3898392]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r30e32b2 r3898392 1 1 #!groovy 2 3 import groovy.transform.Field 2 4 3 5 //=========================================================================================================== … … 22 24 wrap([$class: 'TimestamperBuildWrapper']) { 23 25 24 notify_server(0)25 26 26 Settings = prepare_build() 27 27 … … 34 34 checkout() 35 35 36 notify_server(0)37 38 36 build() 39 37 … … 50 48 BuildDir = pwd tmp: true 51 49 SrcDir = pwd tmp: false 52 53 notify_server(45)54 50 } 55 51 } … … 72 68 finally { 73 69 //Send email with final results if this is not a full build 74 if( Settings && !Settings.Silent ) { 75 email(log_needed, Settings.IsSandbox) 76 } 70 email(log_needed) 77 71 78 72 echo 'Build Completed' … … 116 110 //Also specify the compiler by hand 117 111 targets="" 118 if( Settings.RunAllTests ) {112 if( Settings.RunAllTests || Settings.RunBenchmark ) { 119 113 targets="--with-target-hosts='host:debug,host:nodebug'" 120 114 } else { … … 153 147 dir (BuildDir) { 154 148 //Append bench results 155 sh " ${SrcDir}/benchmark/jenkins.sh ${Settings.GitNewRef} ${Settings.Architecture} ${BuildDir}/bench.json"149 sh "make --no-print-directory -C benchmark jenkins" 156 150 } 157 151 } … … 177 171 178 172 if( !Settings.Publish ) return 173 if( !Settings.RunBenchmark ) { 174 echo 'No results to publish!!!' 175 return 176 } 177 178 def groupCompile = new PlotGroup('Compilation', 'seconds', true) 179 def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false) 179 180 180 181 //Then publish the results 181 sh 'curl --silent --show-error -H \'Content-Type: application/json\' --data @${BuildDir}/bench.json https://cforall.uwaterloo.ca:8082/jenkins/publish > /dev/null || true' 182 do_plot('compile' , groupCompile , 'Compilation') 183 do_plot('ctxswitch', groupConcurrency, 'Context Switching') 184 do_plot('mutex' , groupConcurrency, 'Mutual Exclusion') 185 do_plot('signal' , groupConcurrency, 'Internal and External Scheduling') 182 186 } 183 187 } … … 196 200 197 201 return """ 202 <pre> 198 203 The branch ${env.BRANCH_NAME} has been updated. 199 204 ${gitUpdate} 200 201 Check console output at ${env.BUILD_URL} to view the results. 202 203 - Status -------------------------------------------------------------- 204 205 BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result} 206 207 - Log ----------------------------------------------------------------- 205 </pre> 206 207 <p>Check console output at ${env.BUILD_URL} to view the results.</p> 208 209 <p>- Status --------------------------------------------------------------</p> 210 211 <p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p> 212 213 <p>- Log -----------------------------------------------------------------</p> 214 215 <pre> 208 216 ${gitLog} 209 ----------------------------------------------------------------------- 217 </pre> 218 219 <p>-----------------------------------------------------------------------</p> 220 <pre> 210 221 Summary of changes: 211 222 ${gitDiff} 223 </pre> 212 224 """ 213 225 } 214 226 215 227 //Standard build email notification 216 def email(boolean log , boolean bIsSandbox) {228 def email(boolean log) { 217 229 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 218 230 //Configurations for email format … … 221 233 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 222 234 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}" 223 def email_body = """ This is an automated email from the Jenkins build machine. It was235 def email_body = """<p>This is an automated email from the Jenkins build machine. It was 224 236 generated because of a git hooks/post-receive script following 225 a ref change which was pushed to the C forall repository.237 a ref change which was pushed to the C∀ repository.</p> 226 238 """ + GitLogMessage() 227 239 228 def email_to = "cforall@lists.uwaterloo.ca"229 230 if( Settings && !Settings. IsSandbox) {240 def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca" 241 242 if( Settings && !Settings.Silent ) { 231 243 //send email notification 232 244 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log … … 311 323 } 312 324 325 this.IsSandbox = (branch == "jenkins-sandbox") 313 326 this.RunAllTests = param.RunAllTests 314 327 this.RunBenchmark = param.RunBenchmark … … 316 329 this.Publish = param.Publish 317 330 this.Silent = param.Silent 318 this.IsSandbox = (branch == "jenkins-sandbox")319 331 320 332 def full = param.RunAllTests ? " (Full)" : "" … … 333 345 this.GitNewRef = '' 334 346 this.GitOldRef = '' 347 } 348 } 349 350 class PlotGroup implements Serializable { 351 public String name 352 public String unit 353 public boolean log 354 355 PlotGroup(String name, String unit, boolean log) { 356 this.name = name 357 this.unit = unit 358 this.log = log 335 359 } 336 360 } … … 398 422 } 399 423 400 def notify_server(int wait) {401 sh """curl --silent --show-error --data "wait=${wait}" -X POST https://cforall.uwaterloo.ca:8082/jenkins/notify > /dev/null || true"""402 return403 }404 405 424 def make_doc() { 406 425 def err = null … … 417 436 } 418 437 } 438 439 def do_plot(String file, PlotGroup group, String title) { 440 echo "file is ${BuildDir}/benchmark/${file}.csv, group ${group}, title ${title}" 441 dir("${BuildDir}/benchmark/") { 442 plot csvFileName: "cforall-${env.BRANCH_NAME}-${file}.csv", 443 csvSeries: [[ 444 file: "${file}.csv", 445 exclusionValues: '', 446 displayTableFlag: false, 447 inclusionFlag: 'OFF', 448 url: '' 449 ]], 450 group: "${group.name}", 451 title: "${title}", 452 style: 'lineSimple', 453 exclZero: false, 454 keepRecords: false, 455 logarithmic: group.log, 456 numBuilds: '120', 457 useDescr: true, 458 yaxis: group.unit, 459 yaxisMaximum: '', 460 yaxisMinimum: '' 461 } 462 }
Note: See TracChangeset
for help on using the changeset viewer.