Changeset ec5d599 for Jenkinsfile
- Timestamp:
- Dec 5, 2020, 8:48:42 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- e91a255
- Parents:
- 7c1144b (diff), ad915e0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r7c1144b rec5d599 30 30 SrcDir = pwd tmp: false 31 31 32 clean()33 34 checkout()32 Tools.Clean() 33 34 Tools.Checkout() 35 35 36 36 build() … … 81 81 // Main compilation routines 82 82 //=========================================================================================================== 83 def clean() {84 Tools.BuildStage('Cleanup', true) {85 // clean the build by wipping the build directory86 dir(BuildDir) {87 deleteDir()88 }89 }90 }91 92 //Compilation script is done here but environnement set-up and error handling is done in main loop93 def checkout() {94 Tools.BuildStage('Checkout', true) {95 //checkout the source code and clean the repo96 final scmVars = checkout scm97 Settings.GitNewRef = scmVars.GIT_COMMIT98 Settings.GitOldRef = scmVars.GIT_PREVIOUS_COMMIT99 100 echo GitLogMessage()101 }102 }103 104 83 def build() { 105 84 debug = true … … 236 215 //Routine responsible of sending the email notification once the build is completed 237 216 //=========================================================================================================== 238 @NonCPS239 def SplitLines(String text) {240 def list = []241 242 text.eachLine {243 list += it244 }245 246 return list247 }248 249 def GitLogMessage() {250 if (!Settings || !Settings.GitOldRef || !Settings.GitNewRef) return "\nERROR retrieveing git information!\n"251 252 def oldRef = Settings.GitOldRef253 def newRef = Settings.GitNewRef254 255 def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()256 def revList = SplitLines( revText )257 258 def gitUpdate = ""259 revList.each { rev ->260 def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim()261 gitUpdate = gitUpdate + " via ${rev} (${type})"262 }263 264 def rev = oldRef265 def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim()266 gitUpdate = gitUpdate + " from ${rev} (${type})"267 268 def gitLog = sh(returnStdout: true, script: "git rev-list --format=short ${oldRef}...${newRef}").trim()269 270 def gitDiff = sh(returnStdout: true, script: "git diff --stat --color ${newRef} ${oldRef}").trim()271 gitDiff = gitDiff.replace('[32m', '<span style="color: #00AA00;">')272 gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">')273 gitDiff = gitDiff.replace('[m', '</span>')274 275 return """276 <pre>277 The branch ${env.BRANCH_NAME} has been updated.278 ${gitUpdate}279 </pre>280 281 <p>Check console output at ${env.BUILD_URL} to view the results.</p>282 283 <p>- Status --------------------------------------------------------------</p>284 285 <p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>286 287 <p>- Log -----------------------------------------------------------------</p>288 289 <pre>290 ${gitLog}291 </pre>292 293 <p>-----------------------------------------------------------------------</p>294 <pre>295 Summary of changes:296 ${gitDiff}297 </pre>298 """299 }300 301 217 //Standard build email notification 302 218 def email(boolean log) { … … 310 226 generated because of a git hooks/post-receive script following 311 227 a ref change which was pushed to the C\u2200 repository.</p> 312 """ + GitLogMessage()228 """ + Tools.GitLogMessage() 313 229 314 230 def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca" … … 420 336 this.DescShort = "${ this.Compiler.name }:${ this.Architecture.name }${full}" 421 337 338 final ast = this.NewAST ? "New AST" : "Old AST" 422 339 this.DescLong = """Compiler : ${ this.Compiler.name } (${ this.Compiler.CXX }/${ this.Compiler.CC }) 340 AST Version : ${ ast.toString() } 423 341 Architecture : ${ this.Architecture.name } 424 342 Arc Flags : ${ this.Architecture.flags } … … 473 391 description: 'If true, build compiler using new AST', \ 474 392 name: 'NewAST', \ 475 defaultValue: false, \393 defaultValue: true, \ 476 394 ], \ 477 395 [$class: 'BooleanParameterDefinition', \ … … 479 397 name: 'RunAllTests', \ 480 398 defaultValue: false, \ 481 ], 399 ], \ 482 400 [$class: 'BooleanParameterDefinition', \ 483 401 description: 'If true, jenkins also runs benchmarks', \
Note:
See TracChangeset
for help on using the changeset viewer.