Changeset d4ba8e9


Ignore:
Timestamp:
Aug 2, 2018, 2:14:34 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:
40032ae
Parents:
3f9876e
Message:

Print email body early to debug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r3f9876e rd4ba8e9  
    163163        currentBuild.description = "${compiler.cc_name}:${arch_name}${full}"
    164164
    165         echo currentBuild.changeSets
    166 
    167165        echo """Compiler              : ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc})
    168166Architecture            : ${arch_name}
     
    174172Silent                  : ${ pSilent.toString() }
    175173"""
     174
     175
     176        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
     177        //Configurations for email format
     178        def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
     179
     180        def gitLog = 'Error retrieving git logs'
     181        def gitDiff = 'Error retrieving git diff'
     182        def gitUpdate = 'Error retrieving update'
     183
     184        try {
     185                gitUpdate = gitBranchUpdate(gitRefOldValue, gitRefNewValue)
     186
     187                sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     188                gitLog = readFile('GIT_LOG')
     189
     190                sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
     191                gitDiff = readFile('GIT_DIFF')
     192        }
     193        catch (Exception error) {}
     194
     195        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
     196        def email_body = """This is an automated email from the Jenkins build machine. It was
     197generated because of a git hooks/post-receive script following
     198a ref change was pushed to the repository containing
     199the project "UNNAMED PROJECT".
     200
     201The branch ${env.BRANCH_NAME} has been updated.
     202${gitUpdate}
     203
     204Check console output at ${env.BUILD_URL} to view the results.
     205
     206- Status --------------------------------------------------------------
     207
     208BUILD# ${env.BUILD_NUMBER} - ${status}
     209
     210- Log -----------------------------------------------------------------
     211${gitLog}
     212-----------------------------------------------------------------------
     213Summary of changes:
     214${gitDiff}
     215"""
     216
     217        echo email_body
    176218}
    177219
Note: See TracChangeset for help on using the changeset viewer.