Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. pipeline {
  2. agent none
  3.  
  4. options {
  5. buildDiscarder logRotator(numToKeepStr: '10')
  6. }
  7.  
  8.  
  9. triggers {
  10. eventTrigger jmespathQuery("repository.full_name")
  11. }
  12.  
  13. stages {
  14. stage('Example') {
  15. steps {
  16. script {
  17. String text = ''
  18. env.getEnvironment().each { name, value ->
  19. text += "$name=$value\n"
  20. }
  21. println text
  22. for(cause in currentBuild.rawBuild.getCauses()) {
  23. println "${cause}"
  24. if (cause instanceof com.cloudbees.jenkins.plugins.pipeline.events.EventTriggerCause) {
  25. println "${cause.event}"
  26. }
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement