Changes in Jenkins/tools.groovy [6c9e0bc:9c4ad67]
- File:
-
- 1 edited
-
Jenkins/tools.groovy (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/tools.groovy
r6c9e0bc r9c4ad67 37 37 //checkout the source code and clean the repo 38 38 if(commitHash) { 39 final scmVars = checkout([$class: 'GitSCM', branches: [[name: commitHash ]]]) 39 echo "Checking out commit <${commitHash}>" 40 final scmVars = checkout([$class: 'GitSCM', branches: [[name: commitHash ]], 41 userRemoteConfigs: [[ 42 url: 'cforall@plg.uwaterloo.ca:software/cfa/cfa-cc', 43 credentialsId: 'git_key_aug20']] 44 ]) 40 45 echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT) 41 46 } else { 42 43 47 final scmVars = checkout scm 44 48 echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT) … … 61 65 } 62 66 63 def GitLogMessage(String oldRef, String newRef) { 67 PrevGitOldRef = '' 68 PrevGitNewRef = '' 69 def GitLogMessage(String oldRef = '', String newRef = '') { 70 if (!oldRef) { if(!PrevGitOldRef) { return "\nERROR retrieveing current git information!\n" } else { oldRef = PrevGitOldRef } } 71 if (!newRef) { if(!PrevGitNewRef) { return "\nERROR retrieveing previous git information!\n" } else { newRef = PrevGitNewRef } } 72 64 73 def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim() 65 74 def revList = SplitLines( revText ) … … 81 90 gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">') 82 91 gitDiff = gitDiff.replace('[m', '</span>') 92 93 PrevGitOldRef = oldRef 94 PrevGitNewRef = newRef 83 95 84 96 return """
Note:
See TracChangeset
for help on using the changeset viewer.