Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. Started by user xxxxx
  2. [Pipeline] stage (Test)
  3. Entering stage Test
  4. Proceeding
  5. [Pipeline] node
  6. Running on master in /var/lib/jenkins/jobs/rpk-test/workspace
  7. [Pipeline] {
  8. [Pipeline] sh
  9. [workspace] Running shell script
  10. + exit 1
  11. [Pipeline] step
  12. [Pipeline] }
  13. [Pipeline] // node
  14. [Pipeline] End of Pipeline
  15. ERROR: script returned exit code 1
  16. Finished: FAILURE
  17.  
  18. stage 'Test'
  19. node {
  20. try {
  21. sh 'exit 1'
  22. } finally {
  23. println currentBuild.result // this prints null
  24. step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'me@me.com', sendToIndividuals: true])
  25. }
  26. }
  27.  
  28. stage 'Test'
  29. node {
  30. try {
  31. sh 'exit 1'
  32. currentBuild.result = 'SUCCESS'
  33. } catch (any) {
  34. currentBuild.result = 'FAILURE'
  35. throw any //rethrow exception to prevent the build from proceeding
  36. } finally {
  37. step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'me@me.com', sendToIndividuals: true])
  38. }
  39. }
  40.  
  41. stage 'Test'
  42. node {
  43. catchError {
  44. sh 'exit 1'
  45. }
  46. step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'me@me.com', sendToIndividuals: true])
  47. }
  48.  
  49. pipeline {
  50. agent any
  51. stages {
  52. stage('whatever') {
  53. steps {
  54. ...
  55. }
  56. }
  57. }
  58. post {
  59. always {
  60. step([$class: 'Mailer',
  61. notifyEveryUnstableBuild: true,
  62. recipients: "example@example.com",
  63. sendToIndividuals: true])
  64. }
  65. }
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement