File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import static org.jenkinsci.plugins.github.pullrequest.utils.JobHelper.ghPRTriggerFromJob
2+ import static com.github.kostyasha.github.integration.branch.utils.JobHelper.ghBranchTriggerFromJob
3+
4+ import com.github.kostyasha.github.integration.branch.GitHubBranchTrigger
5+ import org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger
6+
7+ Jenkins . instance. getAllItems(Job . class). each{ job ->
8+ GitHubPRTrigger prTrigger = ghPRTriggerFromJob(job)
9+ if (prTrigger != null ) {
10+ println " Running GH PR trigger for " + job. getFullName()
11+ try {
12+ prTrigger. run()
13+ } catch (Throwable error) {
14+ println " ERROR: failed to run branch trigger for " + job. getFullName()
15+ print error
16+ }
17+ }
18+
19+ GitHubBranchTrigger branchTrigger = ghBranchTriggerFromJob(job)
20+ if (branchTrigger != null ) {
21+ println " Running GH Branch trigger for " + job. getFullName()
22+ try {
23+ branchTrigger. run()
24+ } catch (Throwable error) {
25+ println " ERROR: failed to run branch trigger for " + job. getFullName()
26+ print error
27+
28+ }
29+ }
30+ }
31+ println " "
You can’t perform that action at this time.
0 commit comments