Project

General

Profile

1
def myFile= new File("/tmp/DSL45/configuration.xml")
2
def parser=new XmlSlurper().parseText(myFile.text);
3
def allModule=parser.module.each {
4
        def projectName= it.name as String
5
        def sourceCodeType=it.source.@type
6
        def versionCode = it.source.@version
7
        def URLSource=it.source as String        
8
        def mvnGoal= it.goal as String
9
        def hasSonar= it.sonar as String
10
        def mail = it.mail as String
11
        def myrepositoryId = it.deploy.RepositoryId as String
12
        def repositoryURL = it.deploy.RepositoryURL as String
13
        def nightly = it.nightly as String
14
        def cron_node = it.cron as String
15
        def j_name =  'DSL45_'+projectName          
16
        println "executing "+projectName        
17
        if (versionCode == '4')
18
        {        
19
          mavenJob(j_name) {    
20
            scm {
21
                svn(URLSource)
22
            }
23
            triggers {
24
               scm('H/10 * * * *')
25
               snapshotDependencies(true)
26
            }            
27
            goals(mvnGoal)  
28
            logRotator {
29
                numToKeep(2)
30
                artifactNumToKeep(1)
31
            }      
32
            publishers {
33
                deployArtifacts {
34
                    repositoryUrl (repositoryURL)
35
                    repositoryId (myrepositoryId)
36
                    uniqueVersion (true)
37
                    evenIfUnstable (true)
38
                    }                    
39
                }   
40
            }
41
            configure { project ->
42
                project / 'publishers' / 'jenkins.plugins.slack.SlackNotifier'(plugin: 'slack@2.2"') {
43
                      'baseUrl'()
44
                      'teamDomain'()
45
                      'authToken'()
46
                      'authTokenCredentialId'()
47
                      'botUser'(false)
48
                      'room'()
49
                      'startNotification'(false)
50
                      'notifySuccess'(false)
51
                      'notifyAborted'(false)
52
                      'notifyNotBuilt'(false)
53
                      'notifyUnstable'(true)
54
                      'notifyRegression'(false)
55
                      'notifyFailure'(true)
56
                      'notifyBackToNormal'(true)
57
                      'notifyRepeatedFailure'(false)
58
                      'includeTestSummary'(false)
59
                      'includeFailedTests'(false)
60
                      'commitInfoChoice'('NONE')
61
                      'includeCustomMessage'(false)
62
                      'customMessage'()
63
                }
64
            }
65
        }
66
}
(5-5/6)