Skip to content

Commit

Permalink
IS-2523: Setup app
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikdahlen committed Jul 10, 2024
0 parents commit 53e455d
Show file tree
Hide file tree
Showing 67 changed files with 2,182 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*.{kt,kts}]
ktlint_disabled_rules=import-ordering,no-wildcard-imports,trailing-comma-on-call-site,trailing-comma-on-declaration-site,multiline-if-else
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

21 changes: 21 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "07:00"
open-pull-requests-limit: 10

- package-ecosystem: gradle
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
groups:
minor-and-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"
19 changes: 19 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "CodeQL"

on:
push:
branches:
- main
schedule:
- cron: '0 7 * * 1'

jobs:
monitor:
permissions:
actions: read
contents: read
security-events: write
uses: navikt/isworkflows/.github/workflows/codeql.yml@master
with:
languages: "[ 'java' ]"
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/dependency-submission.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Gradle dependency submission
on:
push:
branches:
- main
paths:
- "**.gradle.kts"
workflow_dispatch:

jobs:
dependency_submission:
permissions:
contents: write
uses: navikt/isworkflows/.github/workflows/gradle-dependency-submission.yml@master
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy to dev-gcp

on:
workflow_dispatch:
inputs:
gitCommit:
description: "Complete git commit to deploy"
required: true
default: ""

jobs:
deploy-dev:
name: Deploy to NAIS Dev-gcp
permissions:
contents: read
id-token: write
uses: navikt/isworkflows/.github/workflows/manual-deploy-dev.yml@master
with:
git-commit: ${{ github.event.inputs.gitCommit }}
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: main

on: push

jobs:
build-and-deploy:
permissions:
contents: read
id-token: write
uses: navikt/isworkflows/.github/workflows/kotlin-build-deploy.yml@master
secrets: inherit
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

76 changes: 76 additions & 0 deletions .nais/naiserator-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: ismanglendemedvirkning
namespace: teamsykefravr
labels:
team: teamsykefravr
spec:
image: {{ image }}
port: 8080
replicas:
min: 2
max: 4
cpuThresholdPercentage: 70
startup:
path: /internal/is_ready
periodSeconds: 5
timeout: 5
failureThreshold: 30
liveness:
path: /internal/is_alive
periodSeconds: 5
timeout: 5
failureThreshold: 3
readiness:
path: /internal/is_ready
periodSeconds: 5
timeout: 5
failureThreshold: 3
leaderElection: true
prometheus:
enabled: true
path: /internal/metrics
resources:
limits:
memory: 512Mi
requests:
cpu: 100m
memory: 384Mi
accessPolicy:
inbound:
rules:
- application: syfomodiaperson
outbound:
external:
- host: "login.microsoftonline.com"
- host: "pdl-api.dev-fss-pub.nais.io"
- host: "dokarkiv.dev-fss-pub.nais.io"
rules:
- application: istilgangskontroll
gcp:
sqlInstances:
- type: POSTGRES_15
databases:
- name: ismanglendemedvirkning-db
diskAutoresize: true
azure:
application:
allowAllUsers: true
enabled: true
claims:
extra:
- "NAVident"
kafka:
pool: nav-dev
observability:
autoInstrumentation:
enabled: true
runtime: java
env:
- name: KTOR_ENV
value: "production"
- name: ISTILGANGSKONTROLL_CLIENT_ID
value: "dev-gcp.teamsykefravr.istilgangskontroll"
- name: ISTILGANGSKONTROLL_URL
value: "http://istilgangskontroll"
76 changes: 76 additions & 0 deletions .nais/naiserator-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: ismanglendemedvirkning
namespace: teamsykefravr
labels:
team: teamsykefravr
spec:
image: {{ image }}
port: 8080
replicas:
min: 2
max: 4
cpuThresholdPercentage: 70
startup:
path: /internal/is_ready
periodSeconds: 5
timeout: 5
failureThreshold: 30
liveness:
path: /internal/is_alive
periodSeconds: 5
timeout: 5
failureThreshold: 3
readiness:
path: /internal/is_ready
periodSeconds: 5
timeout: 5
failureThreshold: 3
leaderElection: true
prometheus:
enabled: true
path: /internal/metrics
resources:
limits:
memory: 512Mi
requests:
cpu: 100m
memory: 384Mi
accessPolicy:
inbound:
rules:
- application: syfomodiaperson
outbound:
external:
- host: "login.microsoftonline.com"
- host: "pdl-api.prod-fss-pub.nais.io"
- host: "dokarkiv.prod-fss-pub.nais.io"
rules:
- application: istilgangskontroll
gcp:
sqlInstances:
- type: POSTGRES_15
databases:
- name: ismanglendemedvirkning-db
diskAutoresize: true
azure:
application:
allowAllUsers: true
enabled: true
claims:
extra:
- "NAVident"
kafka:
pool: nav-prod
observability:
autoInstrumentation:
enabled: true
runtime: java
env:
- name: KTOR_ENV
value: "production"
- name: ISTILGANGSKONTROLL_CLIENT_ID
value: "prod-gcp.teamsykefravr.istilgangskontroll"
- name: ISTILGANGSKONTROLL_URL
value: "http://istilgangskontroll"
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @navikt/digisyfo
* @navikt/teamsykefravr
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM gcr.io/distroless/java21
WORKDIR /app
COPY build/libs/app.jar app.jar
ENV JDK_JAVA_OPTIONS="-XX:MaxRAMPercentage=75 -Dlogback.configurationFile=logback.xml"
ENV TZ="Europe/Oslo"
EXPOSE 8080
USER nonroot
CMD [ "app.jar" ]
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
![Build status](https://github.com/navikt/ismanglendemedvirkning/workflows/main/badge.svg?branch=main)

# ismanglendemedvirkning

Applikasjon for å lagre vurderinger i henhold til §8-8 i folketrygdloven rundt manglende medvirkning til oppfølging fra NAV.

## Technologies used

* Docker
* Gradle
* Kafka
* Kotlin
* Ktor
* Postgres

##### Test Libraries:

* Kluent
* Mockk
* Spek

#### Requirements

* JDK 21

### Build

Run `./gradlew clean shadowJar`

### Lint (Ktlint)

##### Command line

Run checking: `./gradlew --continue ktlintCheck`

Run formatting: `./gradlew ktlintFormat`

##### Git Hooks

Apply checking: `./gradlew addKtlintCheckGitPreCommitHook`

Apply formatting: `./gradlew addKtlintFormatGitPreCommitHook`

## Contact

### For NAV employees

We are available at the Slack channel `#isyfo`.
Loading

0 comments on commit 53e455d

Please sign in to comment.