Skip to content

Commit 15f5486

Browse files
committed
Initial commit
0 parents  commit 15f5486

18 files changed

+549
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[gradlew.bat]
12+
end_of_line = crlf

.github/workflows/master.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: master
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: create image tag
13+
run: echo ::set-env name=IMAGE::docker.pkg.github.com/${{ github.repository }}/spesialist:$(echo ${{ github.sha }} | cut -c1-7)
14+
- uses: actions/checkout@v1
15+
- uses: actions/setup-java@v1
16+
with:
17+
java-version: '12.x'
18+
- name: test and build
19+
run: ./gradlew test build
20+
env:
21+
ORG_GRADLE_PROJECT_githubUser: x-access-token
22+
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
23+
- name: build docker image
24+
run: docker build . --pull -t ${IMAGE}
25+
- name: push docker image
26+
run: |
27+
docker login --username "$GITHUB_REPOSITORY" -p ${{ secrets.GITHUB_TOKEN }} https://docker.pkg.github.com
28+
docker push ${IMAGE}
29+
deployDev:
30+
name: Deploy to dev
31+
needs: build
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Create image tag
35+
run: echo ::set-env name=IMAGE::docker.pkg.github.com/${{ github.repository }}/spesialist:$(echo ${{ github.sha }} | cut -c1-7)
36+
- uses: actions/checkout@v1
37+
- uses: nais/deploy/actions/deploy@v1
38+
env:
39+
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
40+
CLUSTER: dev-fss
41+
RESOURCE: deploy/dev.yml
42+
43+
deployProd:
44+
name: Deploy to prod
45+
needs: [build, deployDev]
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Create image tag
49+
run: echo ::set-env name=IMAGE::docker.pkg.github.com/${{ github.repository }}/spesialist:$(echo ${{ github.sha }} | cut -c1-7)
50+
- uses: actions/checkout@v1
51+
- uses: nais/deploy/actions/deploy@v1
52+
env:
53+
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
54+
CLUSTER: prod-fss
55+
RESOURCE: deploy/prod.yml

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.idea
2+
.gradle
3+
build
4+
out
5+
!/.idea/codeStyles/*.xml
6+
.DS_Store

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @navikt/tbd

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM navikt/java:12
2+
3+
COPY build/libs/*.jar ./
4+
5+
ENV JAVA_OPTS="-XX:MaxRAMPercentage=75 \
6+
-XX:+HeapDumpOnOutOfMemoryError \
7+
-XX:HeapDumpPath=/oom-dump.hprof"
8+
RUN echo 'java -XX:MaxRAMPercentage=75 -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"' > /init-scripts/0-dump-memory-config.sh

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2020 NAV (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Spesialist
2+
Backend for saksbehandling av sykepengesøknader

build.gradle.kts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
kotlin("jvm") version "1.3.70"
3+
}
4+
5+
group = "no.nav.helse"
6+
version = "1.0-SNAPSHOT"
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation(kotlin("stdlib-jdk8"))
14+
implementation("ch.qos.logback:logback-classic:1.2.3")
15+
implementation("io.ktor:ktor-server-cio:1.3.1")
16+
implementation("net.logstash.logback:logstash-logback-encoder:6.3")
17+
}
18+
19+
tasks {
20+
compileKotlin {
21+
kotlinOptions.jvmTarget = "1.8"
22+
}
23+
compileTestKotlin {
24+
kotlinOptions.jvmTarget = "1.8"
25+
}
26+
}

deploy/dev.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apiVersion: nais.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: spesialist
5+
namespace: default
6+
labels:
7+
team: tbd
8+
spec:
9+
image: {{image}}
10+
port: 8080
11+
liveness:
12+
path: isalive
13+
initialDelay: 5
14+
readiness:
15+
path: isready
16+
initialDelay: 5
17+
resources:
18+
limits:
19+
cpu: 2000m
20+
memory: 512Mi
21+
requests:
22+
cpu: 50m
23+
memory: 128Mi
24+
replicas:
25+
min: 1
26+
max: 1
27+
cpuThresholdPercentage: 90
28+
prometheus:
29+
enabled: true
30+
path: /metrics
31+
webproxy: true
32+
secureLogs:
33+
enabled: true
34+
vault:
35+
enabled: true
36+
paths:
37+
- mountPath: /var/run/secrets/nais.io/vault
38+
kvPath: /kv/preprod/fss/spesialist/default
39+
- mountPath: /var/run/secrets/nais.io/service_user
40+
kvPath: /serviceuser/data/dev/srvspesialist
41+
- mountPath: /var/run/secrets/nais.io/azure
42+
kvPath: /azuread/data/dev/creds/spesialist
43+
env:
44+
- name: KAFKA_BOOTSTRAP_SERVERS
45+
value: b27apvl00045.preprod.local:8443,b27apvl00046.preprod.local:8443,b27apvl00047.preprod.local:8443
46+
- name: KAFKA_CONSUMER_GROUP_ID
47+
value: spesialist-v1
48+
- name: DATABASE_HOST
49+
value: b27dbvl009.preprod.local
50+
- name: DATABASE_PORT
51+
value: "5432"
52+
- name: DATABASE_NAME
53+
value: spesialist
54+
- name: VAULT_MOUNTPATH
55+
value: postgresql/preprod-fss/
56+
- name: AZURE_CONFIG_URL
57+
value: https://login.microsoftonline.com/966ac572-f5b7-4bbe-aa88-c76419c0f851/v2.0/.well-known/openid-configuration

deploy/prod.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apiVersion: nais.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: spesialist
5+
namespace: default
6+
labels:
7+
team: tbd
8+
spec:
9+
image: {{image}}
10+
port: 8080
11+
liveness:
12+
path: isalive
13+
initialDelay: 5
14+
readiness:
15+
path: isready
16+
initialDelay: 5
17+
resources:
18+
limits:
19+
cpu: 2000m
20+
memory: 512Mi
21+
requests:
22+
cpu: 50m
23+
memory: 128Mi
24+
replicas:
25+
min: 1
26+
max: 1
27+
cpuThresholdPercentage: 90
28+
prometheus:
29+
enabled: true
30+
path: /metrics
31+
webproxy: true
32+
secureLogs:
33+
enabled: true
34+
vault:
35+
enabled: true
36+
paths:
37+
- mountPath: /var/run/secrets/nais.io/vault
38+
kvPath: /kv/prod/fss/spesialist/default
39+
- mountPath: /var/run/secrets/nais.io/service_user
40+
kvPath: /serviceuser/data/prod/srvspesialist
41+
- mountPath: /var/run/secrets/nais.io/azure
42+
kvPath: /azuread/data/prod/creds/spesialist
43+
env:
44+
- name: KAFKA_BOOTSTRAP_SERVERS
45+
value: a01apvl00145.adeo.no:8443,a01apvl00146.adeo.no:8443,a01apvl00147.adeo.no:8443,a01apvl00148.adeo.no:8443,a01apvl00149.adeo.no:8443,a01apvl00150.adeo.no:8443
46+
- name: KAFKA_CONSUMER_GROUP_ID
47+
value: spesialist-v1
48+
- name: DATABASE_HOST
49+
value: a01dbvl011.adeo.no
50+
- name: DATABASE_PORT
51+
value: "5432"
52+
- name: DATABASE_NAME
53+
value: spesialist
54+
- name: VAULT_MOUNTPATH
55+
value: postgresql/prod-fss/
56+
- name: AZURE_CONFIG_URL
57+
value: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b/v2.0/.well-known/openid-configuration

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlin.code.style=official

gradle/wrapper/gradle-wrapper.jar

53.9 KB
Binary file not shown.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)