Created
April 9, 2019 15:42
This file contains hidden or 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
cause
has:hudson.model.Api getApi()
String getShortDescription()
net.sf.json.JSONObject getEvent()
net.sf.json.JSONObject toExportedObject()