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
        if (versionCode == '4')
17
        {
18
          j_name =  'DSL45_'+projectName          
19
        }
20
        if (versionCode == '5')
21
        {
22
          j_name =  'DSL5_'+projectName          
23
        }
24
        
25
        
26
          mavenJob(j_name) {    
27
            scm {
28
                svn(URLSource)
29
            }
30
            triggers {
31
               scm('H/10 * * * *')
32
               snapshotDependencies(true)
33
            }            
34
            goals(mvnGoal)  
35
            logRotator {
36
                numToKeep(2)
37
                artifactNumToKeep(1)
38
            }      
39
            publishers {
40
                deployArtifacts {
41
                    repositoryUrl (repositoryURL)
42
                    repositoryId (myrepositoryId)
43
                    uniqueVersion (true)
44
                    evenIfUnstable (true)
45
                    }                    
46
                }   
47
            
48
            configure { project ->
49
                project / 'publishers' / 'jenkins.plugins.slack.SlackNotifier'(plugin: 'slack@2.2"') {
50
                      'baseUrl'()
51
                      'teamDomain'()
52
                      'authToken'()
53
                      'authTokenCredentialId'()
54
                      'botUser'(false)
55
                      'room'()
56
                      'startNotification'(false)
57
                      'notifySuccess'(false)
58
                      'notifyAborted'(false)
59
                      'notifyNotBuilt'(false)
60
                      'notifyUnstable'(true)
61
                      'notifyRegression'(false)
62
                      'notifyFailure'(true)
63
                      'notifyBackToNormal'(true)
64
                      'notifyRepeatedFailure'(false)
65
                      'includeTestSummary'(false)
66
                      'includeFailedTests'(false)
67
                      'commitInfoChoice'('NONE')
68
                      'includeCustomMessage'(false)
69
                      'customMessage'()
70
                }
71
            }
72
        }
73
    
74
}
(5-5/6)