Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rfb975a50 r27474a7  
    341341//Routine responsible of sending the email notification once the build is completed
    342342//===========================================================================================================
    343 def gitBranchUpdate(String gitRefOldValue, String gitRefNewValue) {
    344         def update = ""
    345         sh "git rev-list ${gitRefOldValue}..${gitRefNewValue} > GIT_LOG";
    346         readFile('GIT_LOG').eachLine { rev ->
    347                 sh "git cat-file -t ${rev} > GIT_TYPE"
    348                 def type = readFile('GIT_TYPE')
    349 
    350                 update += "       via  ${rev} (${type})\n"
    351         }
    352         def rev = gitRefOldValue
    353         sh "git cat-file -t ${rev} > GIT_TYPE"
    354         def type = readFile('GIT_TYPE')
    355 
    356         update += "      from  ${rev} (${type})\n"
    357         return update
    358 
    359 def output=readFile('result').trim()
    360 echo "output=$output";
    361 }
    362 
    363343//Standard build email notification
    364344def email(String status, boolean log, boolean bIsSandbox) {
     
    369349        def gitLog = 'Error retrieving git logs'
    370350        def gitDiff = 'Error retrieving git diff'
    371         def gitUpdate = 'Error retrieving update'
    372351
    373352        try {
    374                 gitUpdate = gitBranchUpdate(gitRefOldValue, gitRefNewValue)
    375353
    376354                sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     
    380358                gitDiff = readFile('GIT_DIFF')
    381359        }
    382         catch (Exception error) {
    383                 echo error.toString()
    384                 echo error.getMessage()
    385         }
     360        catch (Exception error) {}
    386361
    387362        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
     
    392367
    393368The branch ${env.BRANCH_NAME} has been updated.
    394 ${gitUpdate}
     369   via  ${gitRefOldValue} (commit)
     370  from  ${gitRefNewValue} (commit)
    395371
    396372Check console output at ${env.BUILD_URL} to view the results.
Note: See TracChangeset for help on using the changeset viewer.