This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
plugin-job-generator.dsl
80 lines (76 loc) · 2.25 KB
/
plugin-job-generator.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
72
73
74
75
76
77
78
79
80
def projects = ['azure-vm-agents-plugin', 'azure-credentials-plugin',
'windows-azure-storage-plugin', 'azure-app-service-plugin', 'azure-commons-plugin',
'azure-container-agents-plugin', 'azure-function-plugin', 'azure-acs-plugin',
'kubernetes-cd-plugin', 'azure-ad-plugin']
projects.each {
def gitUrl = "https://github.com/jenkinsci/${it}.git"
// generate pipeline job
multibranchPipelineJob("Plugins/${it}") {
branchSources {
git {
remote(gitUrl)
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(20)
}
}
}
// generate nightly build job
def pattern = 'target/(*).hpi'
if (it == 'azure-commons-plugin') {
pattern = 'azure-commons-plugin/' + pattern
}
def tsParam = '${BUILD_TIMESTAMP}'
def specJson = """\
{
"files": [{
"pattern": "${pattern}",
"target": "nightly-builds/${ -> it}/{1}-NIGHTLY-${tsParam}.hpi",
"recursive": false
}]
}"""
job("Nightly Builds/${it} nightly") {
label('linux-dev')
properties {
zenTimestamp('yyyyMMdd')
}
scm {
git {
remote {
url(gitUrl)
}
branch('*/dev')
}
}
triggers {
scm('H 1 * * *') {
ignorePostCommitHooks()
}
}
steps {
maven("clean verify")
}
configure { project ->
project / 'buildWrappers' / 'org.jfrog.hudson.generic.ArtifactoryGenericConfigurator' {
details {
artifactoryName('vscjenkins-repo')
artifactoryUrl('http://repo-vscjenkins.southeastasia.cloudapp.azure.com')
}
resolverDetails {
artifactoryName('vscjenkins-repo')
artifactoryUrl('http://repo-vscjenkins.southeastasia.cloudapp.azure.com')
}
useSpecs(true)
uploadSpec {
spec(specJson)
}
downloadSpec {
spec()
}
deployBuildInfo(true)
}
}
}
}