-
Notifications
You must be signed in to change notification settings - Fork 70
/
build.gradle
171 lines (137 loc) · 5.47 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
plugins {
id("com.github.node-gradle.node") version "2.2.1"
id "com.moowork.node" version "1.3.1"
id 'com.palantir.docker' version "0.34.0"
id 'org.springframework.boot' version "${springboot_version}"
id "org.cyclonedx.bom" version "1.5.0"
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
node {
// Version of node to use.
version = '12.16.1'
// Version of npm to use.
npmVersion = '6.13.4'
// Version of Yarn to use.
yarnVersion = '1.16.0'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${project.buildDir}/npm")
// Set the work directory for Yarn
yarnWorkDir = file("${project.buildDir}/yarn")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}/../inspectit-ocelot-configurationserver-ui")
}
/**
* Task for installing the frontend dependencies.
*/
task installFrontend(type: YarnTask) {
args = ['install']
}
/**
* Task for building the frontend and copying it to the configuration-server project.
*/
task buildFrontend(type: YarnTask) {
args = ['export']
}
buildFrontend.dependsOn installFrontend
def serverMainClass = 'rocks.inspectit.ocelot.ConfigurationServer'
bootJar {
archivesBaseName = 'inspectit-ocelot-configurationserver-noui'
version = "${buildVersion}"
mainClassName = "${serverMainClass}"
}
/**
* Builds the configuration server and the web frontend.
*/
task bootJarWithFrontend(type: org.springframework.boot.gradle.tasks.bundling.BootJar) {
group = "build"
archivesBaseName = 'inspectit-ocelot-configurationserver'
version = "${buildVersion}"
from("${project.projectDir}/../inspectit-ocelot-configurationserver-ui/out") {
into('static/ui')
}
mainClassName = "${serverMainClass}"
with bootJar
}
bootJarWithFrontend.dependsOn buildFrontend
cyclonedxBom {
includeConfigs += ["runtimeClasspath"]
}
repositories {
mavenCentral()
}
//to guarantee that the Configuration Server is compatible with Java 8 runtime environments
sourceCompatibility = 1.8 // Java version compatibility to use when compiling Java source.
targetCompatibility = 1.8 // Java version to generate classes for.
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
dependencies {
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
}
dependencies {
implementation(
project(':inspectit-ocelot-config'),
project(':inspectit-ocelot-configdocsgenerator'),
"org.springframework.boot:spring-boot-starter-web:${springboot_version}",
"org.springframework.boot:spring-boot-starter-data-jpa:${springboot_version}",
"org.springframework.boot:spring-boot-starter-validation:${springboot_version}",
"org.springframework.security:spring-security-web:5.1.5.RELEASE",
"org.springframework.security:spring-security-config:5.1.5.RELEASE",
"org.springframework.ldap:spring-ldap-core",
"org.springframework.security:spring-security-ldap",
'org.springframework.boot:spring-boot-starter-actuator',
// spring releated
"org.yaml:snakeyaml:1.30",
'org.apache.httpcomponents:httpclient:4.5.12', //Required for PATCH-Requests
"org.xerial:sqlite-jdbc:3.28.0",
"com.github.gwenn:sqlite-dialect:0.1.0",
'io.jsonwebtoken:jjwt-api:0.10.5',
'io.jsonwebtoken:jjwt-impl:0.10.5',
'io.jsonwebtoken:jjwt-jackson:0.10.5',
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.9",
"commons-io:commons-io:2.6",
"org.apache.commons:commons-lang3:3.+",
"org.flywaydb:flyway-core",
"org.eclipse.jgit:org.eclipse.jgit:5.7.0.202003110725-r",
"com.google.code.gson:gson:2.8.5",
// swagger
"io.springfox:springfox-swagger2:2.9.2",
"io.springfox:springfox-swagger-ui:2.9.2",
"io.opentelemetry:opentelemetry-sdk:${openTelemetryVersion}",
"io.opentelemetry:opentelemetry-opencensus-shim:${openTelemetryAlphaVersion}"
)
testImplementation(
'org.springframework.boot:spring-boot-starter-test:2.1.6.RELEASE',
"org.springframework.security:spring-security-test:5.1.5.RELEASE",
'org.junit.jupiter:junit-jupiter-api:5.3.1',
'org.mockito:mockito-junit-jupiter:2.23.0',
'com.h2database:h2:1.4.194',
'org.awaitility:awaitility:3.1.5',
)
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}
task copyServerJar(type: Copy) {
dependsOn bootJarWithFrontend
from("${buildDir}/libs/inspectit-ocelot-configurationserver-${version}.jar")
into("${buildDir}/docker-jar")
rename("inspectit-ocelot-configurationserver-${version}\\.jar",
'inspectit-ocelot-configurationserver.jar')
}
docker {
name "inspectit/inspectit-ocelot-configurationserver"
dependsOn copyServerJar
tag 'versioned', "hub.docker.com/${name}:${version}"
dockerfile file('docker/Dockerfile')
files 'docker/entrypoint.sh', "$buildDir/docker-jar/inspectit-ocelot-configurationserver.jar"
}