Created
April 9, 2019 15:42
-
-
Save ctran/71768dbe912b1d1b867089ca516dae23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent none | |
options { | |
buildDiscarder logRotator(numToKeepStr: '10') | |
} | |
triggers { | |
eventTrigger jmespathQuery("repository.full_name") | |
} | |
stages { | |
stage('Example') { | |
steps { | |
script { | |
String text = '' | |
env.getEnvironment().each { name, value -> | |
text += "$name=$value\n" | |
} | |
println text | |
for(cause in currentBuild.rawBuild.getCauses()) { | |
println "${cause}" | |
if (cause instanceof com.cloudbees.jenkins.plugins.pipeline.events.EventTriggerCause) { | |
println "${cause.event}" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.cloudbees.com/docs/cloudbees-ci/latest/pipelines/cross-team-collaboration