Skip to content

Commit

Permalink
Merge pull request #4 from ministryofjustice/LASB-2633
Browse files Browse the repository at this point in the history
[LASB-2633] Updating initial configs
  • Loading branch information
nittagr committed Oct 27, 2023
2 parents ab83d02 + 3419e67 commit d228455
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker-compose.override.yml filter=git-crypt diff=git-crypt
helm_deploy/**/values-*.yaml filter=git-crypt diff=git-crypt
79 changes: 64 additions & 15 deletions crime-application-tracking/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

plugins {
id 'java'
id "jacoco"
id "org.sonarqube" version "4.0.0.2929"
id "info.solidsoft.pitest" version "1.15.0"
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
}
Expand All @@ -14,10 +17,7 @@ java {

def versions = [
pitest : "1.15.1",
sentryVersion : "6.28.0",
springdocVersion : "2.2.0",
okhttpVersion : "4.12.0",
wiremockVersion : "2.35.0"
sentryVersion : "6.28.0"
]
configurations {
compileOnly {
Expand All @@ -29,18 +29,14 @@ repositories {
mavenCentral()
}

ext {
set('sentryVersion', "6.28.0")
}

dependencies {
implementation platform("io.sentry:sentry-bom:$versions.sentryVersion")

implementation "io.sentry:sentry-spring-boot-starter"
implementation "io.sentry:sentry-logback"

implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-security'
//implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
Expand All @@ -49,16 +45,69 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.security:spring-security-test'
//testImplementation 'org.springframework.security:spring-security-test'
testImplementation "org.pitest:pitest:$versions.pitest"
}

dependencyManagement {
imports {
mavenBom "io.sentry:sentry-bom:${sentryVersion}"
tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

jacoco {
toolVersion = "0.8.11"
}

jacocoTestReport {
dependsOn test
reports {
xml.required = false
html.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/entity/**",
"**/dto/**",
"**/config/**"
])
}))
}
}

tasks.named('test') {
useJUnitPlatform()
pitest {
targetClasses = [
"uk.gov.justice.laa.crime.application.tracking.*",
"uk.gov.justice.laa.crime.application.tracking.controller.*"
]
excludedClasses = [
"uk.gov.justice.laa.crime.application.tracking.dto.*",
"uk.gov.justice.laa.crime.application.tracking.mapper.*",
"uk.gov.justice.laa.crime.application.tracking.CrimeApplicationTrackingApplication"
]
threads = 5
outputFormats = ["XML", "HTML"]
timestampedReports = false
mutationThreshold = 60
}

tasks.named("sonar"){
dependsOn test
}

sonar {
properties {
property "sonar.exclusions", "**/entity/**.java , **/model/**.java , **/dto/**.java , **/config/**.java, **/exception/**.java"
property "sonar.coverage.exclusions", "**/CrimeApplicationTrackingApplication.java"
property "sonar.coverage.jacoco.xmlReportPaths", "${project.layout.buildDirectory}/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.projectKey", "ministryofjustice_laa-crime-application-tracking-service"
property "sonar.organization", "ministryofjustice"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectName", "Crime Apps :: crime-application-tracking"
property "sonar.pitest.mode", "reuseReport"
property "sonar.pitest.reportsDirectory", "build/reports/pitest"
}
}



Binary file not shown.
8 changes: 8 additions & 0 deletions crime-application-tracking/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
version: "3.9"

services:
app:
build:
context: .
ports:
- "8490:8490"
- "8500:8500"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions crime-application-tracking/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
12 changes: 12 additions & 0 deletions crime-application-tracking/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
server:
port: 8490

management:
server:
port: 8500
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
11 changes: 11 additions & 0 deletions crime-application-tracking/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<configuration>
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="Console" />
</root>
</configuration>

0 comments on commit d228455

Please sign in to comment.