Skip to content

Commit d07489c

Browse files
authored
Merge branch 'development' into renovate/org.springframework.boot-spring-boot-starter-actuator-3.x
2 parents 60d7564 + 8687428 commit d07489c

File tree

14 files changed

+249
-142
lines changed

14 files changed

+249
-142
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/issue-branch.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/CI.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
# os: [ubuntu-latest, windows-latest, macos-latest]
2020
os: [ubuntu-latest]
21-
jdk: [17]
21+
jdk: [17, 21]
2222
runs-on: ${{ matrix.os }}
2323
steps:
2424
- name: Checkout repo
@@ -42,15 +42,8 @@ jobs:
4242
run: mkdir -p /tmp/mapping-service/{schemas}
4343
- name: Clean
4444
run: ./gradlew clean
45-
# - if: matrix.os == 'windows-latest'
46-
# name: Test with Gradle on Windows
47-
# run: ./gradlew build -DapplicationProperties="src\test\resources\test-config\application-test-windows.properties"
4845
- if: matrix.os != 'windows-latest'
4946
name: Test with Gradle on ${{ matrix.os }}
5047
run: ./gradlew build -DapplicationProperties="src/test/resources/test-config/application-test.properties"
5148
- name: Generate report
5249
run: ./gradlew jacocoTestReport
53-
# - name: Codecov
54-
# uses: codecov/codecov-action@v1
55-
# with:
56-
# files: ./build/reports/jacoco/test/jacocoTestReport.xml
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish mapping-plugin-core to the Maven Central Repository
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Java
11+
uses: actions/setup-java@v4.7.0
12+
with:
13+
java-version: 17
14+
distribution: 'zulu' # openjdk
15+
- name: Publish package
16+
run: ./gradlew -Prelease publishToSonatype closeAndReleaseSonatypeStagingRepository
17+
env:
18+
ORG_GRADLE_PROJECT_sonatypeUsername : ${{ secrets.OSSRH_USERNAME }}
19+
ORG_GRADLE_PROJECT_sonatypePassword : ${{ secrets.OSSRH_PASSWORD }}
20+
ORG_GRADLE_PROJECT_signingKey : ${{ secrets.SIGNING_KEY }}
21+
ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.SIGNING_SECRET }}
22+

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,24 @@ Dependencies that are needed to build and are not being downloaded via gradle:
2222

2323
`./gradlew build`
2424

25+
The build can be further customized via different build profiles. Available profiles are:
26+
27+
* default - Default build including tests. Used by default.
28+
* minimal - Minimal build without tests for fast local builds
29+
* deploy - Full build including tests, packaging of mapping-plugin-core, and
30+
deployment to maven-central. This build profile is supposed to be
31+
used inside a CI environment, as it requires further configuration,
32+
i.e., credentials for deployment.
33+
34+
The different build profiles can be activated via:
35+
36+
`./gradlew build -PbuildProfile=minimal`
37+
2538
### Python Location
2639

27-
The mapping-service supports plugins running Python code. To provide basic testing for this feature, some tests require configured Python in order to be executed.
40+
The mapping-service supports plugins running Python code. To provide basic testing for this feature, some tests require configured Python in order to be executable.
2841
While at runtime, the Python executable is configured in application.properties, at build time the Python location may differ depending on the build environment.
29-
By default, '/usr/bin/python' is assumed as Python location. If you are using a different Python installation, e.g., under Windows or MacOS, you may either modify
42+
By default, '/usr/bin/python3' is assumed as Python location. If you are using a different Python installation, e.g., under Windows or MacOS, you may either modify
3043
'build.gradle' (look out for pythonExecutable) or you provide the Python executable as command line argument, e.g.,
3144

3245
```
@@ -43,10 +56,15 @@ and modify it according to your needs. Espacially the following properties (at t
4356
| spring.datasource.url | The path points to the location of the database in which your configured mappings are stored. For production use it is not recommended to use the pre-configured H2 database! | jdbc:h2:file:/tmp/mapping-service/database |
4457
| mapping-service.pythonExecutable | The path to your local Python executable. The default uses the pythonExecutable system property provided via -DpythonExecutable= or file:///usr/bin/python3 if no such system property is provided. | ${pythonExecutable:'file:///usr/bin/python3'} |
4558
| mapping-service.pluginLocation | The local folder from where plugins are loaded. The folder will be created on startup if it does not exist. | None |
59+
| mapping-service.codeLocation | The local folder where plugins can checkout code from GitHub. For Python-based plugins, also the virtual env is created in this folder. The folder will be created on startup if it does not exist. | None |
4660
| mapping-service.mappingSchemasLocation | The local folder where the mapping files are stored. The folder will be created on startup if it does not exist. | None |
4761
| mapping-service.jobOutput | The local folder where asynchronous mapping execution job outputs are stored. The folder will be created on startup if it does not exist. | None |
4862
| mapping-service.packagesToScan | Packages scanned for mapping plugins in addition to plugins located in mapping-service.pluginLocation. Typically, this property has not the be changed. | edu.kit.datamanager.mappingservice.plugins.impl |
4963
| mapping-service.executionTimeout | The timeout in seconds a plugin process, i.e., Python of Shell, may take before it is assumed to be stale. | 30 |
64+
| mapping-service.authEnabled | Defines if authentication is enabled or not. If enabled, additional keycloak configuration is required. | false |
65+
| mapping-service.mappingAdminRole | Defines the user role which must be present to be able to administrate the mapping service, i.e., add or remove mappings. | MAPPING_ADMIN |
66+
| management.metrics.export.prometheus.enabled | Enables or disabled capturing of prometheus metrics. | true |
67+
| management.endpoint.metrics.enabled | Enables or disabled the metrics actuator endpoint. This is only needed, if metrics are captured at all. | true |
5068

5169
## Starting the Mapping-Service
5270

build.gradle

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ configurations {
3434
sourceCompatibility = JavaVersion.VERSION_17
3535
targetCompatibility = JavaVersion.VERSION_17
3636

37-
if (System.getProperty('profile') == 'minimal') {
38-
println 'Using minimal profile for building ' + project.getName()
37+
def buildPofile = project.findProperty("buildProfile") ?: "complete"
38+
39+
if (buildPofile == "minimal") {
40+
println 'Using minimal profile (no tests) for building ' + project.getName()
3941
apply from: 'gradle/profile-minimal.gradle'
40-
} else {
41-
println 'Using default profile executing all tests for building ' + project.getName()
42-
apply from: 'gradle/profile-complete.gradle'
42+
} else if (buildPofile == "deploy") {
43+
println 'Using release profile for building ' + project.getName()
44+
apply from: 'gradle/profile-deploy.gradle'
45+
}else {
46+
println 'Using default profile (all tests) for building ' + project.getName()
47+
apply from: 'gradle/profile-default.gradle'
4348
}
4449

4550
repositories {
@@ -68,7 +73,7 @@ dependencies {
6873
implementation 'org.springframework.boot:spring-boot-starter-actuator'
6974

7075
// monitoring
71-
implementation 'io.micronaut.micrometer:micronaut-micrometer-registry-prometheus:5.8.0'
76+
implementation 'io.micronaut.micrometer:micronaut-micrometer-registry-prometheus:5.10.2'
7277
implementation 'org.springframework.boot:spring-boot-starter-actuator:3.4.5'
7378

7479
// springdoc
@@ -122,10 +127,12 @@ dependencies {
122127
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:3.0.3'
123128
}
124129

130+
//customization of java compile task
125131
tasks.withType(JavaCompile) {
126132
options.compilerArgs += ['-Xlint:unchecked']
127133
}
128134

135+
//test configuration
129136
test {
130137
outputs.dir snippetsDir
131138
finalizedBy jacocoTestReport
@@ -138,24 +145,19 @@ test {
138145
testLogging.showStandardStreams = true
139146
}
140147

148+
//jacoco configuration
141149
jacoco {
142150
toolVersion = "0.8.13"
143151
}
144152

145-
jacocoTestReport{
146-
dependsOn test
147-
reports {
148-
xml.required = true
149-
html.required = true
150-
}
151-
}
152-
153+
//asciidoctor configuration, i.e., snippet dir
153154
asciidoctor {
154155
inputs.dir snippetsDir
155156
configurations 'asciidoctorExt'
156157
dependsOn test
157158
}
158159

160+
//generation task of boot jar
159161
bootJar {
160162
dependsOn asciidoctor
161163
//dependsOn 'buildPluginJar'
@@ -168,50 +170,36 @@ bootJar {
168170
manifest {
169171
attributes 'Main-Class': 'org.springframework.boot.loader.launch.PropertiesLauncher'
170172
}
171-
//exclude '**/plugins/impl/**'
172-
173-
// from('build/libs/default-plugins-1.1.2-SNAPSHOT.jar') {
174-
// into('BOOT-INF/lib/plugins' )
175-
// }
176173
launchScript()
177174
}
178175

179-
if (project.hasProperty('release')) {
180-
println 'Using \'release\' profile for building ' + project.getName()
181-
apply from: 'gradle/profile-deploy.gradle'
182-
}
183-
176+
//add build info into manifest
184177
springBoot {
185178
buildInfo()
186179
}
187180

181+
//properties made available for bootRun task execution
188182
bootRun {
189183
systemProperty "spring.config.location", "file:$projectDir/"
190184
systemProperty "pythonLocation", pythonExecutable
191185
}
192186

187+
//define how a new version is tagged and where version information may come from
193188
release {
194189
tagTemplate = 'v${version}'
190+
versionPropertyFile = 'gradle.properties'
191+
versionProperties = ['version', 'mainversion']
195192
}
196193

194+
//Do not generate entire project jar
197195
tasks.named("jar") {
198196
enabled = false
199197
}
200198

201-
//task buildPluginJar(type: Jar) {
202-
// description = 'Bundeling plugin core classes'
203-
// archiveFileName.set("plugin-core-${version}.jar")
204-
// from sourceSets.main.output
205-
// include '**/configuration/ApplicationProperties.class',
206-
// '**/exception.BadExitCodeException.class',
207-
// '**/plugins/AbstractPythonMappingPlugin.class',
208-
// '**/plugins/IMappingPlugin.class',
209-
// '**/plugins/MappingPluginException.class',
210-
// '**/plugins/MappingPluginState.class',
211-
// '**/util/PythonRunnerUtil.class',
212-
// '**/util/ShellRunnerUtil.class'
213-
// includeEmptyDirs false
214-
//}
199+
// Disable generation of Gradle module metadata (.module file)
200+
tasks.withType(GenerateModuleMetadata).configureEach {
201+
enabled = false
202+
}
215203

216204
// task for printing project name.
217205
// should be the last task inside file

0 commit comments

Comments
 (0)