Changeset 7a927ed


Ignore:
Timestamp:
Aug 17, 2018, 4:41:54 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
42ee8f2
Parents:
36fb4ce8
Message:

Jenkins now use script for build logs to reduce output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r36fb4ce8 r7a927ed  
    145145                dir (BuildDir) {
    146146                        //Append bench results
    147                         sh "make --no-print-directory -C benchmark jenkins githash=${newRef} arch=${Settings.Architecture} | tee ${SrcDir}/bench.json"
     147                        sh "make --no-print-directory -C benchmark jenkins githash=${Settings.GitNewRef} arch=${Settings.Architecture} | tee ${SrcDir}/bench.json"
    148148                }
    149149        }
     
    178178//Routine responsible of sending the email notification once the build is completed
    179179//===========================================================================================================
    180 def gitUpdate(String oldRef, String newRef) {
    181         def update = ""
    182         sh "git rev-list ${oldRef}..${newRef} > GIT_LOG";
    183         readFile('GIT_LOG').eachLine { rev ->
    184                 sh "git cat-file -t ${rev} > GIT_TYPE"
    185                 def type = readFile('GIT_TYPE')
    186 
    187                 update += "       via  ${rev} (${type})\n"
    188         }
    189         def rev = oldRef
    190         sh "git cat-file -t ${rev} > GIT_TYPE"
    191         def type = readFile('GIT_TYPE')
    192 
    193         update += "      from  ${rev} (${type})\n"
    194         return update
    195 }
    196 
    197 def gitLog(String oldRef, String newRef) {
    198         sh "git rev-list --format=short ${oldRef}...${newRef} > ${BuildDir}/GIT_LOG"
    199         return readFile("${BuildDir}/GIT_LOG")
    200 }
    201 
    202 def gitDiff(String oldRef, String newRef) {
    203         sh "git diff --stat ${newRef} ${oldRef} > ${BuildDir}/GIT_DIFF"
    204         return readFile("${BuildDir}/GIT_DIFF")
    205 }
    206 
    207180def GitLogMessage() {
    208181        if (!Settings || !Settings.GitOldRef || !Settings.GitNewRef) return "\nERROR retrieveing git information!\n"
    209182
     183        dir(BuildDir) {
     184                sh "${SrcDir}/tools/PrettyGitLogs.sh ${Settings.GitOldRef} ${Settings.GitNewRef}";
     185        }
     186        def gitUpdate = readFile("${BuildDir}/GIT_TYPE").trim()
     187        def gitLog    = readFile("${BuildDir}/GIT_LOG").trim()
     188        def gitDiff   = readFile("${BuildDir}/GIT_DIFF").trim()
     189
    210190        return """
    211191The branch ${env.BRANCH_NAME} has been updated.
    212 ${gitUpdate(Settings.GitOldRef, Settings.GitNewRef)}
     192${gitUpdate}
    213193
    214194Check console output at ${env.BUILD_URL} to view the results.
     
    219199
    220200- Log -----------------------------------------------------------------
    221 ${gitLog(Settings.GitOldRef, Settings.GitNewRef)}
     201${gitLog}
    222202-----------------------------------------------------------------------
    223203Summary of changes:
    224 ${gitDiff(Settings.GitOldRef, Settings.GitNewRef)}
     204${gitDiff}
    225205"""
    226206}
Note: See TracChangeset for help on using the changeset viewer.