-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
115 lines (98 loc) · 3.56 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
plugins {
id "eu.xenit.docker-alfresco" version "5.5.0" apply false
id "be.vbgn.ci-detect" version "0.5.0"
id "org.sonarqube" version "4.3.0.3225"
}
sonarqube {
properties {
properties["sonar.projectKey"] = "xenit-eu_docker-alfresco"
properties["sonar.organization"] = "xenit-eu"
properties["sonar.host.url"] = "https://sonarcloud.io"
properties["sonar.language"] = "java"
if (ci.isPullRequest()) {
properties["sonar.pullrequest.key"] = ci.pullRequest
properties["sonar.pullrequest.branch"] = ci.branch
properties["sonar.pullrequest.base"] = ci.pullRequestTargetBranch
} else {
// GIT_BRANCH allows to push from local development directly to SonarCloud
properties["sonar.branch.name"] = ci.reference != null ? ci.reference : "$System.env.GIT_BRANCH"
}
}
}
import java.util.stream.Collectors
def calcTags(version) {
def tags = [
"${version.major}.${version.minor}.${version.rev}".toString(),
"${version.major}.${version.minor}".toString()
]
if (version.label) {
tags += "${version.major}.${version.minor}.${version.rev}.${version.label}".toString()
}
// For non-master/non-release builds, change the tags to contain branch and build number
def isTestBuild = ci.isCi() && ci.branch != "master" && ci.branch != "release"
if (isTestBuild) {
def branch = ci.branch.replace("/", ".") //slashes are not allowed in docker tags
tags = tags.stream().map({ it + "-build-${branch}-${ci.buildNumber}" }).collect(Collectors.toList());
}
return tags
}
def calcRepository(flavor, isAlfresco) {
def repoName = flavor == "enterprise" ? "private.docker.xenit.eu/alfresco-enterprise" : "docker.io/xenit"
if (isAlfresco) {
return "${repoName}/alfresco-repository-${flavor}";
}
return "${repoName}/alfresco-share-${flavor}";
}
String getTomcatProject(majorVersion) {
println "major version used : ${majorVersion}"
if (majorVersion == 7) {
println 'tomcat-embedded-9'
return ":tomcat-base:tomcat-embedded-9"
}
if (majorVersion == 23) {
println 'tomcat-embedded-10'
return ":tomcat-base:tomcat-embedded-10"
}
return null
}
subprojects {
apply plugin: 'java'
repositories {
mavenCentral()
maven {
url 'https://artifacts.alfresco.com/nexus/content/repositories/public/'
}
// This private repository provides Xenit with Alfresco enterprise artefacts.
// External developers should replace it with their own library repository.
maven {
url 'https://artifacts.alfresco.com/nexus/content/groups/private'
credentials {
username project.property('org.alfresco.maven.nexus.username')
password project.property('org.alfresco.maven.nexus.password')
}
}
}
pluginManager.withPlugin('eu.xenit.docker-config') {
docker {
if (System.getenv("DOCKER_USER") != null) {
registryCredentials {
username = System.getenv("DOCKER_USER")
password = System.getenv("DOCKER_PASSWORD")
}
} else {
logger.debug "using default credentials"
}
}
}
}
// Remove when Alfresco V7.X support is dropped.
project(":tomcat-base:tomcat-embedded-9") {
sonarqube {
skipProject = true
}
}
project(":tomcat-base:tomcat-embedded-10") {
sonarqube {
skipProject = true
}
}