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