-
Notifications
You must be signed in to change notification settings - Fork 8
/
job.dsl
43 lines (33 loc) · 776 Bytes
/
job.dsl
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
def slurper = new ConfigSlurper()
// fix classloader problem using ConfigSlurper in job dsl
slurper.classLoader = this.class.classLoader
def config = slurper.parse(readFileFromWorkspace('microservices.dsl'))
// create job for every microservice
config.microservices.each { name, data ->
createBuildJob(name,data)
}
def createBuildJob(name,data) {
freeStyleJob("${name}-build") {
scm {
git {
remote {
url(data.url)
}
branch(data.branch)
createTag(false)
}
}
triggers {
scm('H/15 * * * *')
}
steps {
maven {
mavenInstallation('3.1.1')
goals('clean install')
}
}
publishers {
archiveJunit('/target/surefire-reports/*.xml')
}
}
}