Services » History » Version 5
Alexey Demakov, 02/04/2016 10:23 PM
1 | 1 | Alexey Demakov | h1. Services |
---|---|---|---|
2 | |||
3 | * "Jenkins Continuous Integration Server":http://forge.ispras.ru:8080 - internal access only |
||
4 | 2 | Alexey Demakov | |
5 | |||
6 | 1 | Alexey Demakov | * "Sonarube quality management platform, dedicated to continuously analyzing and measuring the technical quality of source code":http://forge.ispras.ru:9000 - internal access only |
7 | 2 | Alexey Demakov | |
8 | *build.gradle:* |
||
9 | <pre> |
||
10 | plugins { |
||
11 | id ''org.sonarqube'' version ''1.0'' |
||
12 | } |
||
13 | |||
14 | sonarqube { |
||
15 | properties { |
||
16 | property ''sonar.host.url'', ''http://forge.ispras.ru:9000'' |
||
17 | property ''sonar.jdbc.url'', ''jdbc:mysql://localhost:3306/sonar'' |
||
18 | property ''sonar.jdbc.driverClassName'', ''com.mysql.jdbc.Driver'' |
||
19 | property ''sonar.jdbc.username'', ''sonar'' |
||
20 | property ''sonar.jdbc.password'', ''sonar'' |
||
21 | } |
||
22 | } |
||
23 | </pre> |
||
24 | |||
25 | 1 | Alexey Demakov | * "Nexus Repository manager":http://forge.ispras.ru:8082/nexus/ - internal access only |
26 | 4 | Alexey Demakov | Mail <demakov@ispras.ru> is you need upload permissions. |
27 | 2 | Alexey Demakov | |
28 | *build.gradle:* |
||
29 | <pre> |
||
30 | plugins { |
||
31 | id ''net.saliman.properties'' version ''1.4.4'' |
||
32 | id ''net.researchgate.release'' version ''2.3.5'' |
||
33 | } |
||
34 | |||
35 | apply plugin: ''maven-publish'' |
||
36 | |||
37 | 3 | Alexey Demakov | repositories { |
38 | maven { |
||
39 | url ''http://forge.ispras.ru:8082/nexus/content/repositories/snapshots'' |
||
40 | } |
||
41 | maven { |
||
42 | url ''http://forge.ispras.ru:8082/nexus/content/repositories/releases'' |
||
43 | } |
||
44 | jcenter() |
||
45 | } |
||
46 | |||
47 | 2 | Alexey Demakov | project.group = projectGroup |
48 | |||
49 | release { |
||
50 | failOnCommitNeeded = false |
||
51 | |||
52 | versionPatterns = [ |
||
53 | // Increments build number: "0.2.5-alpha-150428" => "0.2.6-alpha-150428" |
||
54 | /(^\d+\.\d+\.)(\d+)(-[^-]*)(-[^-]*$)/: |
||
55 | { Matcher m, Project p -> m.replaceAll("${ m[0][1] }${ (m[0][2] as int) + 1 }${ m[0][3] }" ) } |
||
56 | ] |
||
57 | } |
||
58 | |||
59 | String getCurrentDateString() { |
||
60 | new SimpleDateFormat( ''yyMMdd'' ).format( new Date() ) |
||
61 | } |
||
62 | |||
63 | task unSnapshotVersion.doLast { |
||
64 | def version = project.version.toString() |
||
65 | version += ''-'' + getCurrentDateString() |
||
66 | project.plugins.getPlugin( net.researchgate.release.ReleasePlugin.class ) |
||
67 | .updateVersionProperty( version ) |
||
68 | } |
||
69 | |||
70 | 5 | Alexey Demakov | def repoUrlStr = ''http://forge.ispras.ru:8082/nexus/content/repositories/'' |
71 | def repoUserStr = hasProperty(''repoUser'') ? repoUser : '''' |
||
72 | def repoPasswordStr = hasProperty(''repoPassword'') ? repoPassword : '''' |
||
73 | |||
74 | 2 | Alexey Demakov | publishing { |
75 | publications { |
||
76 | maven(MavenPublication) { |
||
77 | groupId projectGroup |
||
78 | artifactId projectName |
||
79 | version project.version |
||
80 | |||
81 | from components.java |
||
82 | } |
||
83 | } |
||
84 | repositories { |
||
85 | maven { |
||
86 | 1 | Alexey Demakov | if(project.version.endsWith(''-SNAPSHOT'')) { |
87 | 5 | Alexey Demakov | url repoUrlStr + ''snapshots'' |
88 | 1 | Alexey Demakov | } else { |
89 | 5 | Alexey Demakov | url repoUrlStr + ''releases'' |
90 | 2 | Alexey Demakov | } |
91 | credentials { |
||
92 | 5 | Alexey Demakov | username repoUserStr |
93 | password repoPasswordStr |
||
94 | 2 | Alexey Demakov | } |
95 | authentication { |
||
96 | basic(BasicAuthentication) |
||
97 | } |
||
98 | } |
||
99 | } |
||
100 | } |
||
101 | |||
102 | afterReleaseBuild.dependsOn publish |
||
103 | </pre> |
||
104 | |||
105 | *gradle.properties:* |
||
106 | <pre> |
||
107 | projectGroup=... |
||
108 | projectName=.. |
||
109 | # gradle-release-plugin restriction: use only ''='' as separator |
||
110 | version=... |
||
111 | </pre> |
||
112 | |||
113 | *gradle-local.properties:* |
||
114 | <pre>repoUser=... |
||
115 | repoPassword=... |
||
116 | </pre> |
||
117 | |||
118 | *.gitignore:* |
||
119 | <pre> |
||
120 | gradle-local.properties |
||
121 | </pre> |
||
122 | |||
123 | *settings.gradle:* |
||
124 | <pre> |
||
125 | rootProject.name = projectName |
||
126 | </pre> |