Changeset d29a394
- Timestamp:
- Dec 3, 2020, 8:56:11 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7b2a786, cf2257f
- Parents:
- c3d3c22
- Location:
- Jenkins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/Distribute
rc3d3c22 rd29a394 26 26 wrap([$class: 'TimestamperBuildWrapper']) { 27 27 28 gitref= prepare_build()28 final commit = prepare_build() 29 29 30 30 node('x64') { … … 34 34 Tools.clean() 35 35 36 Tools.checkout( gitref)36 Tools.checkout( commit ) 37 37 } 38 38 -
Jenkins/tools.groovy
rc3d3c22 rd29a394 1 1 #!groovy 2 2 3 import groovy.transform.Field 3 4 4 5 // For skipping stages … … 32 33 } 33 34 35 def checkout(commitHash = null) { 36 BuildStage('Checkout', true) { 37 //checkout the source code and clean the repo 38 final scmVars = ref ? checkout scm : checkout([$class: 'GitSCM', branches: [[name: commitHash ]]]) 39 40 echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT) 41 } 42 } 43 44 //=========================================================================================================== 45 //Routine responsible of sending the email notification once the build is completed 46 //=========================================================================================================== 47 @NonCPS 48 def SplitLines(String text) { 49 def list = [] 50 51 text.eachLine { 52 list += it 53 } 54 55 return list 56 } 57 58 def GitLogMessage(String oldRef, String newRef) { 59 def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim() 60 def revList = SplitLines( revText ) 61 62 def gitUpdate = "" 63 revList.each { rev -> 64 def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim() 65 gitUpdate = gitUpdate + " via ${rev} (${type})" 66 } 67 68 def rev = oldRef 69 def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim() 70 gitUpdate = gitUpdate + " from ${rev} (${type})" 71 72 def gitLog = sh(returnStdout: true, script: "git rev-list --format=short ${oldRef}...${newRef}").trim() 73 74 def gitDiff = sh(returnStdout: true, script: "git diff --stat --color ${newRef} ${oldRef}").trim() 75 gitDiff = gitDiff.replace('[32m', '<span style="color: #00AA00;">') 76 gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">') 77 gitDiff = gitDiff.replace('[m', '</span>') 78 79 return """ 80 <pre> 81 The branch ${env.BRANCH_NAME} has been updated. 82 ${gitUpdate} 83 </pre> 84 85 <p>Check console output at ${env.BUILD_URL} to view the results.</p> 86 87 <p>- Status --------------------------------------------------------------</p> 88 89 <p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p> 90 91 <p>- Log -----------------------------------------------------------------</p> 92 93 <pre> 94 ${gitLog} 95 </pre> 96 97 <p>-----------------------------------------------------------------------</p> 98 <pre> 99 Summary of changes: 100 ${gitDiff} 101 </pre> 102 """ 103 } 104 34 105 return this;
Note: See TracChangeset
for help on using the changeset viewer.