forked from linagora/james-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-github-branch
48 lines (44 loc) · 1.46 KB
/
build-github-branch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import groovy.transform.TupleConstructor
@TupleConstructor()
class BranchOnRepo {
String repo
String branch
String originalBranch = ""
}
def branchesToBuild = [
new BranchOnRepo('apache/james-project', 'master'),
new BranchOnRepo('apache/james-project', '3.1.x', '3.1.x'),
new BranchOnRepo('apache/james-project', '3.2.x', '3.2.x'),
new BranchOnRepo('apache/james-project', '3.3.x', '3.3.x'),
new BranchOnRepo('linagora/james-project', 'openpaas-1.2.x', 'openpaas-1.2.x')
]
branchesToBuild.each {
def branchOnRepo = it
def repository = 'https://github.com/' + branchOnRepo.repo
job("build ${branchOnRepo.repo} ${branchOnRepo.branch}".replaceAll(/\//, '.')) {
githubProjectUrl(repository)
scm {
git {
remote {
url(repository + '.git')
}
branch(branchOnRepo.branch)
}
}
triggers {
scm('* * * * *') {
ignorePostCommitHooks(false)
}
}
steps {
downstreamParameterized {
trigger('workflow', 'ALWAYS', false,
[buildStepFailure: 'FAILURE',
failure : 'FAILURE',
unstable : 'UNSTABLE']) {
predefinedProps([repoURL: repository, branch: branchOnRepo.branch, originalBranch: branchOnRepo.originalBranch])
}
}
}
}
}