Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/tools.groovy

    r9c4ad67 r6c9e0bc  
    3737                //checkout the source code and clean the repo
    3838                if(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                         ])
     39                        final scmVars = checkout([$class: 'GitSCM', branches: [[name: commitHash ]]])
    4540                        echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT)
    4641                } else {
     42
    4743                        final scmVars = checkout scm
    4844                        echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT)
     
    6561}
    6662
    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 
     63def GitLogMessage(String oldRef, String newRef) {
    7364        def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()
    7465        def revList = SplitLines( revText )
     
    9081        gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">')
    9182        gitDiff = gitDiff.replace('[m', '</span>')
    92 
    93         PrevGitOldRef = oldRef
    94         PrevGitNewRef = newRef
    9583
    9684        return """
Note: See TracChangeset for help on using the changeset viewer.