Changes in / [0c827019:455a7d5]
- File:
-
- 1 edited
-
Jenkinsfile (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r0c827019 r455a7d5 341 341 //Routine responsible of sending the email notification once the build is completed 342 342 //=========================================================================================================== 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 343 363 //Standard build email notification 344 364 def email(String status, boolean log, boolean bIsSandbox) { … … 349 369 def gitLog = 'Error retrieving git logs' 350 370 def gitDiff = 'Error retrieving git diff' 371 def gitUpdate = 'Error retrieving update' 351 372 352 373 try { 374 gitUpdate = gitBranchUpdate(gitRefOldValue, gitRefNewValue) 353 375 354 376 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" … … 358 380 gitDiff = readFile('GIT_DIFF') 359 381 } 360 catch (Exception error) {} 382 catch (Exception error) { 383 echo error.toString() 384 echo error.getMessage() 385 } 361 386 362 387 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}" … … 367 392 368 393 The branch ${env.BRANCH_NAME} has been updated. 369 via ${gitRefOldValue} (commit) 370 from ${gitRefNewValue} (commit) 394 ${gitUpdate} 371 395 372 396 Check console output at ${env.BUILD_URL} to view the results.
Note:
See TracChangeset
for help on using the changeset viewer.