Skip to content

Commit

Permalink
Feature/kodeverk service (#3449)
Browse files Browse the repository at this point in the history
Ny tjeneste kodeverk-service som kaller sentralt kodeverk
  • Loading branch information
krharum authored Apr 4, 2024
1 parent 301c3da commit 8c4dc7e
Show file tree
Hide file tree
Showing 32 changed files with 1,309 additions and 67 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/app.kodeverk-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: kodeverk-service

on:
push:
paths:
- libs/security-core
- libs/reactive-core
- libs/reactive-security
- libs/data-transfer-objects
- apps/kodeverk-service/**
- .github/workflows/app.kodeverk-service.yml

jobs:
workflow:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "apps/kodeverk-service"
deploy-tag: "#deploy-kodeverk-service"
permissions:
contents: read
id-token: write
secrets: inherit
8 changes: 8 additions & 0 deletions apps/kodeverk-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/navikt/baseimages/temurin:21
LABEL maintainer="Team Dolly"

ENV JAVA_OPTS="-Dspring.profiles.active=prod"

ADD build/libs/app.jar /app/app.jar

EXPOSE 8080
9 changes: 9 additions & 0 deletions apps/kodeverk-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Testnav-Kodeverk-Service
Henter, formatterer, og cacher data fra felles kodeverk.

## Swagger
Swagger finnes under [/swagger](https://testnav-kodeverk-service.intern.dev.nav.no/swagger-ui.html) -endepunktet til
applikasjonen.

## Lokal kjøring
Sett profile til dev
76 changes: 76 additions & 0 deletions apps/kodeverk-service/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
id 'java'
id "org.sonarqube" version "4.4.1.3373"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

test {
useJUnitPlatform()
}

sonarqube {
properties {
property "sonar.dynamicAnalysis", "reuseReports"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.language", "java"
property "sonar.token", System.getenv("SONAR_TOKEN")
property "sonar.organization", "navikt"
property "sonar.project.monorepo.enabled", true
property "sonar.projectKey", "testnav-kodeverk-service"
property "sonar.projectName", "testnav-kodeverk-service"
property "sonar.sourceEncoding", "UTF-8"
}
}
bootJar {
archiveFileName = "app.jar"
}

dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {

implementation 'no.nav.testnav.libs:security-core'
implementation 'no.nav.testnav.libs:reactive-core'
implementation 'no.nav.testnav.libs:reactive-security'
implementation 'no.nav.testnav.libs:data-transfer-objects'

implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'

implementation 'org.springframework.cloud:spring-cloud-starter-vault-config'
implementation 'org.springframework.boot:spring-boot-starter-cache'

implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'

implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.hibernate.validator:hibernate-validator'

implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

description = 'kodeverk-service'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
58 changes: 58 additions & 0 deletions apps/kodeverk-service/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: testnav-kodeverk-service
namespace: dolly
labels:
team: dolly
spec:
image: "{{image}}"
port: 8080
accessPolicy:
inbound:
rules:
- application: app-1
namespace: plattformsikkerhet
- application: dolly-backend
- application: dolly-backend-dev
- application: dolly-frontend
- application: dolly-frontend-dev
- application: dolly-idporten
- application: team-dolly-lokal-app
- application: testnav-oversikt-frontend
- application: testnav-pdl-forvalter
- application: testnav-pdl-forvalter-dev
outbound:
external:
- host: kodeverk-api.nav.no
tokenx:
enabled: true
azure:
application:
allowAllUsers: true
enabled: true
tenant: nav.no
liveness:
path: /internal/isAlive
initialDelay: 4
periodSeconds: 5
failureThreshold: 10
readiness:
path: /internal/isReady
initialDelay: 4
periodSeconds: 5
failureThreshold: 10
prometheus:
enabled: true
path: /internal/metrics
replicas:
min: 1
max: 1
resources:
requests:
cpu: 200m
memory: 2048Mi
limits:
memory: 2048Mi
ingresses:
- "https://testnav-kodeverk-service.intern.dev.nav.no"
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8c4dc7e

Please sign in to comment.