diff --git a/.drone.yml b/.drone.yml index 803968d..ee8b2a9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,12 +16,16 @@ steps: - name: build-image image: plugins/docker settings: - registry: registry.local:5000 - repo: registry.local:5000/hemhub/api + registry: rubble.se:5000 + repo: rubble.se:5000/hemhub/api tags: - ${DRONE_BRANCH/\//-}-${DRONE_COMMIT_SHA:0:7} - latest dockerfile: Dockerfile + username: + from_secret: docker_username + password: + from_secret: docker_password when: branch: include: [ main, develop ] @@ -31,11 +35,15 @@ steps: - name: publish-tag image: plugins/docker settings: - registry: registry.local:5000 - repo: registry.local:5000/hemhub/api + registry: rubble.se:5000 + repo: rubble.se:5000/hemhub/api tags: - ${DRONE_TAG} dockerfile: Dockerfile + username: + from_secret: docker_username + password: + from_secret: docker_password when: event: include: [ tag ] diff --git a/build.gradle b/build.gradle index d0ad5c6..0454f64 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.3.4' id 'io.spring.dependency-management' version '1.1.6' + id 'jacoco' } group = 'se.urmo' @@ -21,4 +22,31 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-starter-test' } +test { + useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + html.required = true + } +} + +jacocoTestCoverageVerification { + violationRules { + rule { + limit { + counter = 'LINE' + value = 'COVEREDRATIO' + minimum = 0.65 // börja rimligt (65%), höj senare + } + } + } +} + +check.dependsOn jacocoTestCoverageVerification + tasks.test { useJUnitPlatform() }