This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci_jobs.groovy
112 lines (106 loc) · 3.07 KB
/
ci_jobs.groovy
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
jdk = 'JDK 17'
maven = 'Maven 3.9'
mavenSettings = 'oss-maven-settings'
gitCredentials = 'GitHub'
String[] modulesWithIT = [
'commandline-tool',
'core-framework',
'java-plugin',
'junit-plugin',
'json-plugin',
'maven-plugin',
'maven3-plugin',
'neo4j-backend',
'plugin-common',
'xml-plugin',
'yaml2-plugin'
]
String[] modulesWithSimpleBuild = [
'bill-of-materials',
'distribution-specification',
'manual',
'plugin-parent',
'uber-parent'
]
modulesWithIT.each {
def module = it
def gitUrl = "https://github.com/jqassistant/jqa-${module}"
def continuousJob = addJob(gitUrl, module, 'ci', 'clean verify -Djqassistant.skip')
addJob(gitUrl, module, 'it', 'clean deploy -PIT -Djqassistant.failOnSeverity=MINOR', continuousJob)
}
modulesWithSimpleBuild.each {
def module = it
def gitUrl = "https://github.com/jqassistant/jqa-${module}"
addJob(gitUrl, module, 'ci', 'clean deploy -Djqassistant.failOnSeverity=MINOR')
}
listView('jQAssistant') {
jobs {
regex("jqa-.+")
}
columns {
status()
weather()
name()
lastSuccess()
lastFailure()
lastDuration()
buildButton()
}
}
def addJob(gitUrl, module, suffix, mavenGoals, upstreamJob = null, disableJob = false, queueJob = false) {
def jobName = "jqa-${module}-${suffix}-ManagedBuild"
job = mavenJob(jobName) {
authorization {
permission('hudson.model.Item.Discover', 'anonymous')
permission('hudson.model.Item.Read', 'anonymous')
permission('hudson.model.Item.Workspace', 'anonymous')
}
logRotator {
numToKeep(10)
}
// Use a shared repo for enabling trigger on SNAPSHOT changes
localRepository(LocalRepositoryLocation.LOCAL_TO_EXECUTOR)
wrappers {
timeout {
absolute(minutes = 90)
}
}
scm {
git {
remote {
url(gitUrl)
credentials(gitCredentials)
}
branches('refs/heads/master')
}
}
triggers {
if (upstreamJob) {
upstream(upstreamJob.name, 'SUCCESS')
} else {
scm('H/15 * * * *')
snapshotDependencies(true)
timerTrigger {
// trigger timer build once a week on sundays
spec('H H(7-10) * * 7')
}
}
}
jdk(jdk)
mavenInstallation(maven)
providedSettings(mavenSettings)
mavenOpts('--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dmaven.test.failure.ignore=false');
goals(mavenGoals)
fingerprintingDisabled()
publishers {
mailer('[email protected]', true, true)
}
if (disableJob) {
disabled()
}
}
if (queueJob) {
queue(job)
}
return job
}