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