Project

General

Profile

1 46394 sandro.lab
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 46474 sandro.lab
        def myrepositoryId = it.deploy.RepositoryId as String
12 46394 sandro.lab
        def repositoryURL = it.deploy.RepositoryURL as String
13
        def nightly = it.nightly as String
14
        def cron_node = it.cron as String
15 46521 sandro.lab
        def j_name =  'DSL45_'+projectName
16 46399 sandro.lab
        if (versionCode == '4')
17 46647 sandro.lab
        {
18
          j_name =  'DSL45_'+projectName
19
        }
20
        if (versionCode == '5')
21
        {
22
          j_name =  'DSL5_'+projectName
23
        }
24
25
26 46474 sandro.lab
          mavenJob(j_name) {
27
            scm {
28
                svn(URLSource)
29
            }
30
            triggers {
31
               scm('H/10 * * * *')
32 46521 sandro.lab
               snapshotDependencies(true)
33 46608 sandro.lab
            }
34 46567 sandro.lab
            goals(mvnGoal)
35
            logRotator {
36
                numToKeep(2)
37
                artifactNumToKeep(1)
38
            }
39 46474 sandro.lab
            publishers {
40
                deployArtifacts {
41
                    repositoryUrl (repositoryURL)
42
                    repositoryId (myrepositoryId)
43
                    uniqueVersion (true)
44
                    evenIfUnstable (true)
45 46567 sandro.lab
                    }
46 46474 sandro.lab
                }
47 46640 sandro.lab
48 46638 sandro.lab
            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 46399 sandro.lab
        }
73 46647 sandro.lab
74 46394 sandro.lab
}