forked from eventuate-foundation/eventuate-cdc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
192 lines (159 loc) · 5.7 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootPluginVersion")
classpath "com.avast.gradle:gradle-docker-compose-plugin:0.12.0"
classpath "io.eventuate.plugins.gradle:eventuate-plugins-gradle-publish:$eventuatePluginsGradleVersion"
}
}
plugins {
id "com.github.hierynomus.license" version "0.12.1"
}
apply plugin: 'docker-compose'
apply plugin: DockerServicesPlugin
apply plugin: "io.eventuate.plugins.gradle.publish.EventuatePublish"
apply plugin: "io.eventuate.plugins.gradle.publish.EventuatePublishDockerImages"
allprojects {
group = "io.eventuate.cdc"
}
projects {
license {
header rootProject.file('src/license/HEADER')
}
}
subprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } }
}
dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:2.6.1")) {
exclude group: 'org.apache.kafka'
exclude group: 'ch.qos.logback'
}
implementation 'ch.qos.logback:logback-classic:1.2.9'
implementation 'ch.qos.logback:logback-core:1.2.9'
testImplementation "junit:junit:4.12"
}
}
if (!project.ext.has("database")) {
project.ext.set("database", System.env.DATABASE == null || System.env.DATABASE == "" ? "mysql" : "$System.env.DATABASE")
}
if (!project.ext.has("databaseVersion")) {
project.ext.set("databaseVersion", System.env.DATABASE_VERSION == null ? "" : "$System.env.DATABASE_VERSION")
}
if (!project.ext.has("mode")) {
project.ext.set("mode", System.env.MODE == null || System.env.MODE == "" ? "binlog" : "$System.env.MODE")
}
if (mode == "unified") {
project.ext.set("databaseDockerFile", "docker-compose-unified.yml")
project.ext.set("databaseDockerCdcFile", "docker-compose-cdc-unified.yml")
} else {
project.ext.set("databaseDockerFile", "docker-compose-${database}${databaseVersion}.yml")
project.ext.set("databaseDockerCdcFile", "docker-compose-cdc-${database}-${mode}.yml")
}
dockerCompose {
environment.put "EVENTUATE_COMMON_VERSION", eventuateCommonImageVersion
environment.put "EVENTUATE_ACTIVE_MQ_VERSION", eventuateActiveMQImageVersion
environment.put "EVENTUATE_RABBIT_MQ_VERSION", eventuateRabbitMQImageVersion
environment.put "DOCKER_IMAGE_TAG", dockerImageTag
removeOrphans = true
mysql {
projectName = null
useComposeFiles = ["docker-compose-mysql.yml"]
removeContainers = project.ext.removeContainers
}
mysql8 {
projectName = null
useComposeFiles = ["docker-compose-mysql8.yml"]
removeContainers = project.ext.removeContainers
}
mysqlonly {
projectName = null
useComposeFiles = ["docker-compose-mysql.yml"]
removeContainers = project.ext.removeContainers
startedServices = ["mysql"]
removeOrphans = false
}
mysql8only {
projectName = null
useComposeFiles = ["docker-compose-mysql8.yml"]
removeContainers = project.ext.removeContainers
startedServices = ["mysql8"]
removeOrphans = false
}
mysqlmigration {
projectName = null
removeContainers = project.ext.removeContainers
useComposeFiles = ["docker-compose-eventuate-local-mysql-for-migration.yml"]
startedServices = project.ext.composeStartedServices()
}
mariadb {
projectName = null
useComposeFiles = ["docker-compose-mariadb.yml"]
removeContainers = project.ext.removeContainers
}
mariadbonly {
projectName = null
useComposeFiles = ["docker-compose-mariadb.yml"]
removeContainers = project.ext.removeContainers
startedServices = ["mariadb"]
removeOrphans = false
}
mssql {
projectName = null
useComposeFiles = ["docker-compose-mssql.yml"]
removeContainers = project.ext.removeContainers
}
mssqlonly {
projectName = null
useComposeFiles = ["docker-compose-mssql.yml"]
removeContainers = project.ext.removeContainers
startedServices = ["mssql"]
removeOrphans = false
}
postgres {
projectName = null
useComposeFiles = ["docker-compose-postgres.yml"]
removeContainers = project.ext.removeContainers
}
postgresonly {
projectName = null
useComposeFiles = ["docker-compose-postgres.yml"]
removeContainers = project.ext.removeContainers
startedServices = ["postgres"]
removeOrphans = false
}
unified {
projectName = null
useComposeFiles = ["docker-compose-unified.yml", "docker-compose-cdc-unified.yml"]
removeContainers = project.ext.removeContainers
}
publish {
projectName = null
useComposeFiles = ["docker-compose-mysql.yml", "docker-compose-cdc-mysql-binlog.yml"]
removeContainers = project.ext.removeContainers
}
}
task aggregatedTestReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allTests")
// Include the results from the 'test' task in all subprojects
reportOn subprojects*.test
}
gradle.projectsEvaluated {
task aggregateJavaDocs(type: Javadoc) {
description = 'Aggregates Javadoc API documentation of all subprojects.'
group = JavaBasePlugin.DOCUMENTATION_GROUP
destinationDir file("$buildDir/docs/javadoc")
}
}