Changes in Jenkinsfile [3898392:30e32b2]
- File:
-
- 1 edited
-
Jenkinsfile (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r3898392 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 } … … 171 177 172 178 if( !Settings.Publish ) return 173 if( !Settings.RunBenchmark ) {174 echo 'No results to publish!!!'175 return176 }177 178 def groupCompile = new PlotGroup('Compilation', 'seconds', true)179 def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false)180 179 181 180 //Then publish the results 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') 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' 186 182 } 187 183 } … … 200 196 201 197 return """ 202 <pre>203 198 The branch ${env.BRANCH_NAME} has been updated. 204 199 ${gitUpdate} 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> 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 ----------------------------------------------------------------- 216 208 ${gitLog} 217 </pre> 218 219 <p>-----------------------------------------------------------------------</p> 220 <pre> 209 ----------------------------------------------------------------------- 221 210 Summary of changes: 222 211 ${gitDiff} 223 </pre>224 212 """ 225 213 } 226 214 227 215 //Standard build email notification 228 def email(boolean log ) {216 def email(boolean log, boolean bIsSandbox) { 229 217 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 230 218 //Configurations for email format … … 233 221 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 234 222 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}" 235 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 236 224 generated because of a git hooks/post-receive script following 237 a ref change which was pushed to the C ∀ repository.</p>225 a ref change which was pushed to the Cforall repository. 238 226 """ + GitLogMessage() 239 227 240 def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"241 242 if( Settings && !Settings. Silent) {228 def email_to = "cforall@lists.uwaterloo.ca" 229 230 if( Settings && !Settings.IsSandbox ) { 243 231 //send email notification 244 232 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log … … 323 311 } 324 312 325 this.IsSandbox = (branch == "jenkins-sandbox")326 313 this.RunAllTests = param.RunAllTests 327 314 this.RunBenchmark = param.RunBenchmark … … 329 316 this.Publish = param.Publish 330 317 this.Silent = param.Silent 318 this.IsSandbox = (branch == "jenkins-sandbox") 331 319 332 320 def full = param.RunAllTests ? " (Full)" : "" … … 345 333 this.GitNewRef = '' 346 334 this.GitOldRef = '' 347 }348 }349 350 class PlotGroup implements Serializable {351 public String name352 public String unit353 public boolean log354 355 PlotGroup(String name, String unit, boolean log) {356 this.name = name357 this.unit = unit358 this.log = log359 335 } 360 336 } … … 422 398 } 423 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 424 405 def make_doc() { 425 406 def err = null … … 436 417 } 437 418 } 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.