-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
168 lines (135 loc) · 6.14 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
import org.springframework.boot.gradle.tasks.run.BootRun
plugins {
id 'java'
id 'java-test-fixtures'
id 'jacoco'
id 'org.springframework.boot' version '3.3.3'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.sonarqube' version '5.1.0.4882'
id "be.vbgn.ci-detect" version "0.5.0"
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
bootRun {
systemProperty("spring.profiles.active", "bootRun")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
// Configure all bootRun tasks to use the toolchain from above
tasks.withType(BootRun.class).configureEach {
var toolchain = project.extensions.getByType(JavaPluginExtension.class).toolchain;
var toolchainService = project.extensions.getByType(JavaToolchainService.class);
it.javaLauncher.convention(toolchainService.launcherFor(toolchain))
}
tasks.register("keycloakBootRun", BootRun.class) {
description = "Runs the Spring Boot application with the Keycloak profile"
group = ApplicationPlugin.APPLICATION_GROUP
classpath = tasks.bootRun.classpath
mainClass = tasks.bootRun.mainClass
systemProperty("spring.profiles.active", "bootRun,keycloak")
}
tasks.register("consoleBootRun", BootRun.class) {
description = "Runs the Spring Boot application with routing config for ContentGrid Console development"
group = ApplicationPlugin.APPLICATION_GROUP
classpath = tasks.bootRun.classpath
mainClass = tasks.bootRun.mainClass
systemProperty("spring.profiles.active", "bootRun,console")
}
tasks.register("runtimeBootRun", BootRun.class) {
description = "Runs ContentGrid Gateway with config for ContentGrid Runtime Platform"
group = ApplicationPlugin.APPLICATION_GROUP
classpath = tasks.bootRun.classpath
mainClass = tasks.bootRun.mainClass
systemProperty("spring.profiles.active", "bootRun,runtime")
systemProperty("reactor.netty.http.server.accessLogEnabled", "true")
}
dependencies {
implementation platform('org.springframework.cloud:spring-cloud-dependencies:2023.0.3')
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing'
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.micrometer:micrometer-registry-otlp'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'
implementation platform('com.contentgrid.thunx:thunx-bom:0.11.0')
implementation 'com.contentgrid.thunx:thunx-gateway-spring-boot-starter'
implementation 'com.contentgrid.thunx:thunx-encoding-json'
implementation platform('com.contentgrid.configuration:contentgrid-configuration-bom:0.1.2')
implementation 'com.contentgrid.configuration:contentgrid-configuration-contentgrid-apps'
runtimeOnly('com.contentgrid.configuration:contentgrid-configuration-kubernetes-fabric8') {
// We need an older kubernetes client than provided by contentgrid configuration to be compatible with Spring Boot
exclude group: 'io.fabric8'
}
runtimeOnly 'com.contentgrid.configuration:contentgrid-configuration-properties-spring'
runtimeOnly 'com.contentgrid.configuration:contentgrid-configuration-autoconfigure'
implementation 'org.springframework.cloud:spring-cloud-kubernetes-fabric8-loadbalancer'
runtimeOnly 'org.bouncycastle:bcpkix-jdk18on:1.79'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
testImplementation 'io.rest-assured:rest-assured'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'com.github.dasniko:testcontainers-keycloak:3.5.1'
testImplementation 'org.testcontainers:k3s'
testImplementation 'org.awaitility:awaitility'
testFixturesCompileOnly 'org.projectlombok:lombok'
testFixturesAnnotationProcessor 'org.projectlombok:lombok'
testFixturesApi 'com.nimbusds:nimbus-jose-jwt:9.45'
testFixturesApi 'org.assertj:assertj-core'
testFixturesApi 'org.bouncycastle:bcprov-jdk18on:1.79'
testFixturesApi 'org.springframework:spring-webflux'
testFixturesApi 'org.springframework.security:spring-security-crypto'
testFixturesApi 'org.springframework.cloud:spring-cloud-commons'
testFixturesApi platform('com.contentgrid.configuration:contentgrid-configuration-bom:0.1.2')
testFixturesApi 'com.contentgrid.configuration:contentgrid-configuration-contentgrid-apps'
testFixturesImplementation platform('org.springframework.cloud:spring-cloud-dependencies:2023.0.3')
testFixturesImplementation 'io.projectreactor:reactor-test'
testFixturesImplementation 'com.fasterxml.jackson.core:jackson-databind'
testFixturesImplementation 'org.springframework.security:spring-security-core'
testFixturesImplementation 'org.springframework.security:spring-security-oauth2-core'
}
test {
useJUnitPlatform()
}
bootBuildImage {
def dockerImageRepo = "ghcr.io/xenit-eu/contentgrid-gateway"
imageName = "${dockerImageRepo}:${project.version}"
tags = "${project.version}".endsWith('SNAPSHOT') ? [ "${dockerImageRepo}:SNAPSHOT" ] : null
if (!ci.isCi()) {
tags.add("${dockerImageRepo}:local")
}
docker {
publishRegistry {
url = project.findProperty('DOCKER_PUBLISH_REGISTRY_URL')
username = project.findProperty('DOCKER_PUBLISH_REGISTRY_USERNAME')
password = project.findProperty('DOCKER_PUBLISH_REGISTRY_PASSWORD')
}
}
}
jacocoTestReport {
reports {
xml.required = true
}
}
sonarqube {
properties {
property "sonar.projectKey", "contentgrid-gateway"
property "sonar.organization", "xenit-eu"
property "sonar.host.url", "https://sonarcloud.io"
}
}