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 50732 sandro.lab
                svn {
29 50733 sandro.lab
                    location(URLSource)
30
                    checkoutStrategy(SvnCheckoutStrategy.CHECKOUT)
31
                  }
32 46474 sandro.lab
            }
33
            triggers {
34
               scm('H/10 * * * *')
35 46521 sandro.lab
               snapshotDependencies(true)
36 46608 sandro.lab
            }
37 46567 sandro.lab
            goals(mvnGoal)
38
            logRotator {
39
                numToKeep(2)
40
                artifactNumToKeep(1)
41
            }
42 46474 sandro.lab
            publishers {
43
                deployArtifacts {
44
                    repositoryUrl (repositoryURL)
45
                    repositoryId (myrepositoryId)
46
                    uniqueVersion (true)
47
                    evenIfUnstable (true)
48 46567 sandro.lab
                    }
49 46474 sandro.lab
                }
50 46640 sandro.lab
51 46638 sandro.lab
            configure { project ->
52
                project / 'publishers' / 'jenkins.plugins.slack.SlackNotifier'(plugin: 'slack@2.2"') {
53
                      'baseUrl'()
54
                      'teamDomain'()
55
                      'authToken'()
56
                      'authTokenCredentialId'()
57
                      'botUser'(false)
58
                      'room'()
59
                      'startNotification'(false)
60
                      'notifySuccess'(false)
61
                      'notifyAborted'(false)
62
                      'notifyNotBuilt'(false)
63
                      'notifyUnstable'(true)
64
                      'notifyRegression'(false)
65
                      'notifyFailure'(true)
66
                      'notifyBackToNormal'(true)
67
                      'notifyRepeatedFailure'(false)
68
                      'includeTestSummary'(false)
69
                      'includeFailedTests'(false)
70
                      'commitInfoChoice'('NONE')
71
                      'includeCustomMessage'(false)
72
                      'customMessage'()
73
                }
74
            }
75 46399 sandro.lab
        }
76 46647 sandro.lab
77 46394 sandro.lab
}