Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe5cd41749 | ||
|
|
3a25e33f3f | ||
|
|
ec625fb7b5 | ||
|
|
c8e4474175 | ||
|
|
499c85ae49 | ||
|
|
e88d98efc1 | ||
|
|
8d545aa7fb | ||
|
|
a04094bc60 | ||
|
|
7d68612e57 | ||
|
|
64295db0e7 | ||
|
|
6dcd302ab7 | ||
|
|
e50e769e22 | ||
|
|
b7c85e2368 | ||
|
|
a60289fc49 | ||
|
|
9c4feee043 | ||
|
|
1a50b40eaf | ||
|
|
3c7464a0cf | ||
|
|
2fe84fec45 | ||
|
|
bc1f85865c | ||
|
|
17bde7aa42 | ||
|
|
9d21dfe032 | ||
|
|
e463f0b7a8 | ||
|
|
36345e5338 |
+1
-1
@@ -80,7 +80,7 @@ steps:
|
|||||||
- touch $HOME/.ssh/known_hosts
|
- touch $HOME/.ssh/known_hosts
|
||||||
- chmod 600 $HOME/.ssh/known_hosts
|
- chmod 600 $HOME/.ssh/known_hosts
|
||||||
- ssh-keyscan -H git.2martens.de > $HOME/.ssh/known_hosts 2>/dev/null
|
- ssh-keyscan -H git.2martens.de > $HOME/.ssh/known_hosts 2>/dev/null
|
||||||
- GIT_SSH=/drone/src/module-deploy/scripts/ssh-git-command.sh ./gradlew final jib
|
- ./gradlew -Prelease.useLastTag=true final jib
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ build/
|
|||||||
**/*.log
|
**/*.log
|
||||||
**/*.hprof
|
**/*.hprof
|
||||||
**/generated/**
|
**/generated/**
|
||||||
|
env.sh
|
||||||
|
|
||||||
### STS ###
|
### STS ###
|
||||||
.apt_generated
|
.apt_generated
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import org.gradle.accessors.dm.LibrariesForLibs
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
import java.time.ZonedDateTime
|
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
jacoco
|
jacoco
|
||||||
@@ -51,22 +49,6 @@ tasks.jacocoTestReport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
|
|
||||||
|
|
||||||
tasks.jar {
|
|
||||||
doFirst {
|
|
||||||
manifest {
|
|
||||||
attributes["Implementation-Title"] = rootProject.name
|
|
||||||
attributes["Implementation-Version"] = archiveVersion.get()
|
|
||||||
attributes["Implementation-Vendor"] = "Jim Martens"
|
|
||||||
attributes["Build-Timestamp"] = ZonedDateTime.now().format(formatter)
|
|
||||||
attributes["Created-By"] = "Gradle ${gradle.gradleVersion}"
|
|
||||||
attributes["Build-Jdk"] = "${providers.systemProperty("java.version").get()} (${providers.systemProperty("java.vendor").get()} ${providers.systemProperty("java.vm.version").get()})"
|
|
||||||
attributes["Build-OS"] = "${providers.systemProperty("os.name").get()} ${providers.systemProperty("os.arch").get()} ${providers.systemProperty("os.version").get()}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
normalization.runtimeClasspath.metaInf {
|
normalization.runtimeClasspath.metaInf {
|
||||||
ignoreAttribute("Build-Timestamp")
|
ignoreAttribute("Build-Timestamp")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ tasks.register("writeVersionProperties") {
|
|||||||
val directory = buildDir
|
val directory = buildDir
|
||||||
doLast {
|
doLast {
|
||||||
Files.createDirectories(directory.toPath())
|
Files.createDirectories(directory.toPath())
|
||||||
File("$buildDir/version.properties").writeText("VERSION=${project.version.toString()}\n")
|
File("$buildDir/version.properties").writeText("VERSION=${project.version}\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
import org.gradle.accessors.dm.LibrariesForLibs
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
import java.time.ZonedDateTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
import java.time.format.DateTimeFormatter.ofPattern
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.springframework.boot")
|
id("org.springframework.boot")
|
||||||
@@ -57,27 +60,21 @@ tasks.named("buildAll") {
|
|||||||
dependsOn("integrationTest")
|
dependsOn("integrationTest")
|
||||||
}
|
}
|
||||||
|
|
||||||
springBoot {
|
val formatter: DateTimeFormatter = ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
|
||||||
buildInfo()
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.bootJar {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.jar {
|
tasks.jar {
|
||||||
enabled = true
|
manifest {
|
||||||
archiveClassifier.set("")
|
attributes["Implementation-Title"] = rootProject.name
|
||||||
|
attributes["Implementation-Version"] = archiveVersion.get()
|
||||||
|
attributes["Implementation-Vendor"] = "Jim Martens"
|
||||||
|
attributes["Build-Timestamp"] = ZonedDateTime.now().format(formatter)
|
||||||
|
attributes["Created-By"] = "Gradle ${gradle.gradleVersion}"
|
||||||
|
attributes["Build-Jdk"] = "${providers.systemProperty("java.version").get()} (${providers.systemProperty("java.vendor").get()} ${providers.systemProperty("java.vm.version").get()})"
|
||||||
|
attributes["Build-OS"] = "${providers.systemProperty("os.name").get()} ${providers.systemProperty("os.arch").get()} ${providers.systemProperty("os.version").get()}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.bootDistZip {
|
springBoot {
|
||||||
dependsOn(tasks.jar)
|
buildInfo()
|
||||||
}
|
mainClass.set("de.twomartens.wahlrecht.MainApplicationKt")
|
||||||
|
|
||||||
tasks.bootDistTar {
|
|
||||||
dependsOn(tasks.jar)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.bootStartScripts {
|
|
||||||
dependsOn(tasks.jar)
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
POST http://localhost:12000/wahlrecht/v1/calculate
|
POST {{backend}}/wahlrecht/v1/calculate
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
GET {{backend}}/wahlrecht/v1/elections
|
||||||
|
Content-Type: application/json
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"dev": {
|
||||||
|
"backend": "http://localhost:12000"
|
||||||
|
},
|
||||||
|
"prod" : {
|
||||||
|
"backend": "https://api.2martens.de"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,10 +31,8 @@ jib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
container {
|
container {
|
||||||
extraClasspath = listOf("/configmap")
|
mainClass = "de.twomartens.wahlrecht.MainApplicationKt"
|
||||||
mainClass = "de.twomartens.wahlrecht.MainApplication"
|
|
||||||
jvmFlags = listOf("-XX:+UseContainerSupport",
|
jvmFlags = listOf("-XX:+UseContainerSupport",
|
||||||
"-XX:MaxRAMPercentage=75.0",
|
"-XX:MaxRAMPercentage=75.0")
|
||||||
"-Dlog4j.configurationFile=/configmap/log4j2.xml")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
server:
|
|
||||||
port: 12000
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
ssh $@
|
|
||||||
+3
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.security.OAuthFlows
|
|||||||
import io.swagger.v3.oas.annotations.security.SecurityScheme
|
import io.swagger.v3.oas.annotations.security.SecurityScheme
|
||||||
import io.swagger.v3.oas.models.OpenAPI
|
import io.swagger.v3.oas.models.OpenAPI
|
||||||
import io.swagger.v3.oas.models.info.Info
|
import io.swagger.v3.oas.models.info.Info
|
||||||
|
import io.swagger.v3.oas.models.servers.Server
|
||||||
import org.springframework.beans.factory.annotation.Value
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
@@ -35,5 +36,7 @@ open class OpenApiConfiguration {
|
|||||||
.version(apiVersion)
|
.version(apiVersion)
|
||||||
.description(apiDescription)
|
.description(apiDescription)
|
||||||
)
|
)
|
||||||
|
.addServersItem(Server().url("http://localhost:12000"))
|
||||||
|
.addServersItem(Server().url("https://api.2martens.de"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -17,9 +17,12 @@ open class WebConfiguration(private val headerInterceptorRest: HeaderInterceptor
|
|||||||
val registration = registry.addMapping("/**")
|
val registration = registry.addMapping("/**")
|
||||||
registration.allowedMethods(
|
registration.allowedMethods(
|
||||||
HttpMethod.GET.name(), HttpMethod.POST.name(),
|
HttpMethod.GET.name(), HttpMethod.POST.name(),
|
||||||
HttpMethod.PUT.name(), HttpMethod.OPTIONS.name()
|
HttpMethod.PUT.name(), HttpMethod.HEAD.name()
|
||||||
)
|
)
|
||||||
registration.allowCredentials(true)
|
registration.allowCredentials(true)
|
||||||
registration.allowedOrigins("http://localhost:4200")
|
registration.allowedOrigins(
|
||||||
|
"http://localhost:4200",
|
||||||
|
"https://wahlrecht.2martens.de"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -32,14 +32,16 @@ class VersionHtmlController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getTitle(): String {
|
private fun getTitle(): String {
|
||||||
val title = VersionHtmlController::class.java.getPackage().implementationTitle
|
val title = VersionHtmlController::class.java.`package`.implementationTitle
|
||||||
|
?: return "application"
|
||||||
return title.ifBlank {
|
return title.ifBlank {
|
||||||
"application"
|
"application"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getVersion(): String {
|
private fun getVersion(): String {
|
||||||
val version = VersionHtmlController::class.java.getPackage().implementationVersion
|
val version = VersionHtmlController::class.java.`package`.implementationVersion
|
||||||
|
?: return "DEVELOPER"
|
||||||
return version.ifBlank {
|
return version.ifBlank {
|
||||||
"DEVELOPER"
|
"DEVELOPER"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,6 @@
|
|||||||
package de.twomartens.wahlrecht.controller.v1
|
package de.twomartens.wahlrecht.controller.v1
|
||||||
|
|
||||||
|
import de.twomartens.wahlrecht.property.ServiceProperties
|
||||||
import io.swagger.v3.oas.annotations.Hidden
|
import io.swagger.v3.oas.annotations.Hidden
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
@@ -7,11 +8,12 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = ["/wahlrecht/v1"])
|
@RequestMapping(value = ["/wahlrecht/v1"])
|
||||||
class HealthCheckController {
|
class HealthCheckController(private val properties: ServiceProperties) {
|
||||||
|
|
||||||
|
|
||||||
@Hidden
|
@Hidden
|
||||||
@GetMapping("/healthCheck")
|
@GetMapping("/healthCheck")
|
||||||
fun healthCheck(message: String): String {
|
fun healthCheck(message: String): String {
|
||||||
return message
|
return properties.greeting.format(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
spring:
|
||||||
|
config:
|
||||||
|
import:
|
||||||
|
- "classpath:config/wahlrecht.yaml"
|
||||||
|
- "optional:configserver:http://configserver:8888/config"
|
||||||
@@ -23,9 +23,9 @@ management:
|
|||||||
http.server.requests: true
|
http.server.requests: true
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
spring:
|
|
||||||
config:
|
config:
|
||||||
import: "optional:configserver:http://localhost:8888/config"
|
import:
|
||||||
|
- "classpath:config/wahlrecht.yaml"
|
||||||
main:
|
main:
|
||||||
banner-mode: off
|
banner-mode: off
|
||||||
profiles:
|
profiles:
|
||||||
@@ -42,16 +42,6 @@ spring:
|
|||||||
name: wahlrecht
|
name: wahlrecht
|
||||||
|
|
||||||
|
|
||||||
# properties for application
|
|
||||||
de.twomartens.wahlrecht:
|
|
||||||
defaultTimeZone: Europe/Berlin
|
|
||||||
greeting: "Hello %s"
|
|
||||||
statusprobe:
|
|
||||||
scheduleDuration: 60
|
|
||||||
maxKafkaFailureDuration: 5
|
|
||||||
maxBlobFailureCount: 5
|
|
||||||
maxFailurePercent: 50
|
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
display-request-duration: true
|
display-request-duration: true
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
de.twomartens.wahlrecht:
|
||||||
|
greeting: "Moin %s"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
de.twomartens.wahlrecht:
|
||||||
|
defaultTimeZone: Europe/Berlin
|
||||||
|
greeting: "Hello %s"
|
||||||
|
statusprobe:
|
||||||
|
scheduleDuration: 60
|
||||||
|
maxKafkaFailureDuration: 5
|
||||||
|
maxBlobFailureCount: 5
|
||||||
|
maxFailurePercent: 50
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
./gradlew -Prelease.scope=major $@
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
./gradlew -Prelease.scope=minor $@
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
./gradlew -Prelease.scope=patch $@
|
||||||
Reference in New Issue
Block a user