Revision 45691
Added by Sandro La Bruzzo about 7 years ago
modules/dnetDSL-job/DSL_Creator.py | ||
---|---|---|
46 | 46 |
os.makedirs('/tmp/DSL40') |
47 | 47 |
client = pysvn.Client() |
48 | 48 |
|
49 |
entry_list = client.ls("http://svn-public.driver.research-infrastructures.eu/driver/dnet40/build/")
|
|
50 |
entry_module_list = client.ls("http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/")
|
|
51 |
webapp_module_list = client.ls("http://svn-public.driver.research-infrastructures.eu/driver/dnet40/webapps/")
|
|
49 |
entry_list = []]
|
|
50 |
entry_module_list = client.ls("http://svn-public.driver.research-infrastructures.eu/driver/dnet50/modules/")
|
|
51 |
webapp_module_list = client.ls("http://svn-public.driver.research-infrastructures.eu/driver/dnet50/webapps/")
|
|
52 | 52 |
entry_list = entry_list+ entry_module_list + webapp_module_list |
53 | 53 |
data_list =[] |
54 | 54 |
renderer = pystache.Renderer() |
55 | 55 |
|
56 |
f = open("/tmp/DSL40/configuration.xml", "w")
|
|
56 |
f = open("/tmp/DSL50/configuration.xml", "w")
|
|
57 | 57 |
f.write('<?xml version="1.0"?>') |
58 | 58 |
f.write("\n") |
59 | 59 |
f.write("<modules>") |
modules/dnetDSL-job/job.groovy | ||
---|---|---|
1 |
def myFile= new File("/tmp/DSL40/configuration.xml")
|
|
1 |
def myFile= new File("/tmp/DSL50/configuration.xml")
|
|
2 | 2 |
def parser=new XmlSlurper().parseText(myFile.text); |
3 | 3 |
def allModule=parser.module.each { |
4 | 4 |
def projectName= it.name as String |
5 | 5 |
def sourceCodeType=it.source.@type |
6 | 6 |
def versionCode = it.source.@version |
7 |
def URLSource=it.source as String
|
|
7 |
def URLSource=it.source as String |
|
8 | 8 |
def mvnGoal= it.goal as String |
9 | 9 |
def hasSonar= it.sonar as String |
10 | 10 |
def mail = it.mail as String |
... | ... | |
14 | 14 |
def cron_node = it.cron as String |
15 | 15 |
println "executing "+projectName |
16 | 16 |
job(type: Maven) { |
17 |
if (versionCode == '4')
|
|
18 |
{
|
|
17 |
if (versionCode == '5')
|
|
18 |
{ |
|
19 | 19 |
if (nightly =='true'){ |
20 |
name 'DSL4_nightly_'+projectName
|
|
21 |
using ("dnet-nightly-template")
|
|
22 |
}
|
|
20 |
name 'DSL5_nightly_'+projectName
|
|
21 |
using ("dnet-nightly-template") |
|
22 |
} |
|
23 | 23 |
else{ |
24 |
name 'DSL4_'+projectName
|
|
24 |
name 'DSL5_'+projectName
|
|
25 | 25 |
using ("dnet4-svn-template") |
26 | 26 |
} |
27 | 27 |
} |
... | ... | |
29 | 29 |
name 'DSL_'+projectName |
30 | 30 |
using ("dnet-svn-template") |
31 | 31 |
} |
32 |
|
|
33 |
triggers
|
|
32 |
|
|
33 |
triggers |
|
34 | 34 |
{ |
35 | 35 |
if (nightly !='true'){ |
36 | 36 |
scm('H/10 * * * *') |
... | ... | |
39 | 39 |
{ |
40 | 40 |
cron(cron_node) |
41 | 41 |
} |
42 |
}
|
|
43 |
configure {
|
|
44 |
project ->
|
|
42 |
} |
|
43 |
configure { |
|
44 |
project -> |
|
45 | 45 |
def goalModule=project / goals |
46 | 46 |
goalModule.value=mvnGoal |
47 | 47 |
def scm= project / scm |
48 |
def remoteNode= scm.locations.'hudson.scm.SubversionSCM_-ModuleLocation'[0].remote[0]
|
|
49 |
remoteNode.value=URLSource
|
|
50 |
|
|
48 |
def remoteNode= scm.locations.'hudson.scm.SubversionSCM_-ModuleLocation'[0].remote[0] |
|
49 |
remoteNode.value=URLSource |
|
50 |
|
|
51 | 51 |
if (mail){ |
52 | 52 |
def publishersNode = project /publishers |
53 | 53 |
if (repositoryId) { |
... | ... | |
86 | 86 |
TriggerNode.appendNode('contentType').value='text/html' |
87 | 87 |
|
88 | 88 |
|
89 |
}
|
|
89 |
} |
|
90 | 90 |
if (hasSonar.equals("YES")) { |
91 | 91 |
def pubblish=(project /publishers) |
92 | 92 |
ppNode=pubblish.appendNode('hudson.plugins.sonar.SonarPublisher') |
... | ... | |
95 | 95 |
} |
96 | 96 |
} |
97 | 97 |
} |
98 |
} |
|
98 |
} |
Also available in: Unified diff
created a new version for DNet 5