Changeset 3f9876e for Jenkinsfile


Ignore:
Timestamp:
Aug 2, 2018, 2:12:46 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:
d4ba8e9
Parents:
f4778a0
Message:

Tentative fix of git log in email

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rf4778a0 r3f9876e  
    343343//Routine responsible of sending the email notification once the build is completed
    344344//===========================================================================================================
     345def gitBranchUpdate(String gitRefOldValue, String gitRefNewValue) {
     346        def update = ""
     347        sh "git rev-list $oldrev..$newrev > GIT_LOG";
     348        readFile('GIT_LOG').eachLine { rev ->
     349                sh "git cat-file -t ${rev} > GIT_TYPE"
     350                def type = readFile('GIT_TYPE')
     351
     352                update += "       via  ${rev} (${type})\n"
     353        }
     354        def rev = gitRefOldValue
     355        sh "git cat-file -t ${rev} > GIT_TYPE"
     356        def type = readFile('GIT_TYPE')
     357
     358        update += "      from  ${rev} (${type})\n"
     359        return update
     360
     361def output=readFile('result').trim()
     362echo "output=$output";
     363}
     364
    345365//Standard build email notification
    346366def email(String status, boolean log, boolean bIsSandbox) {
     
    351371        def gitLog = 'Error retrieving git logs'
    352372        def gitDiff = 'Error retrieving git diff'
     373        def gitUpdate = 'Error retrieving update'
    353374
    354375        try {
     376                gitUpdate = gitBranchUpdate(gitRefOldValue, gitRefNewValue)
    355377
    356378                sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     
    369391
    370392The branch ${env.BRANCH_NAME} has been updated.
    371    via  ${gitRefOldValue} (commit)
    372   from  ${gitRefNewValue} (commit)
     393${gitUpdate}
    373394
    374395Check console output at ${env.BUILD_URL} to view the results.
Note: See TracChangeset for help on using the changeset viewer.