-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile.dsl
71 lines (66 loc) · 1.78 KB
/
Jenkinsfile.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
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
// 2git pipeline
multibranchPipelineJob('2gitPipeline') {
displayName('2git pipeline')
configure {
it / sources / data / "jenkins.branch.BranchSource" / "source" (class: "org.jenkinsci.plugins.github_branch_source.GitHubSCMSource") << {
scanCredentialsId "github"
id "2git-github"
repoOwner "Praqma"
repository "2git"
traits {
"org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait" {
strategyId 1
}
}
}
it / sources / data / "jenkins.branch.BranchSource" / strategy (class: "jenkins.branch.DefaultBranchPropertyStrategy") {
properties (class: "java.util.Arrays\$ArrayList") {
a (class: "jenkins.branch.BranchProperty-array") {
"jenkins.branch.NoTriggerBranchProperty" {}
}
}
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(20)
daysToKeep(360)
}
}
}
// 2git seed job
pipelineJob ('2git-pipeline-seed') {
triggers {
cron('@midnight')
}
definition {
cps {
script("""\
import javaposse.jobdsl.plugin.*
node("master") {
git branch: "master", credentialsId: "github", url: "[email protected]:Praqma/2git.git"
step([
\$class: 'ExecuteDslScripts',
targets: "Jenkinsfile.dsl",
ignoreMissingFiles: true,
ignoreExisting: false,
removedJobAction: RemovedJobAction.DELETE,
removedViewAction: RemovedViewAction.DELETE,
lookupStrategy: LookupStrategy.JENKINS_ROOT,
additionalClasspath: ""
])
}""".stripIndent())
}
}
}
listView('2git') {
jobs {
regex('2git.+')
}
columns {
status()
weather()
name()
buildButton()
}
}