Skip to content

Commit f0065cd

Browse files
committed
Initial commit with minimum functionality
1 parent 977e335 commit f0065cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3307
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.gradle
2+
/build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
/out/
5+
/codemr
6+
7+
### IntelliJ IDEA ###
8+
.idea
9+
*.iws
10+
*.iml
11+
*.ipr

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @navikt/team-eessi-pensjon

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM navikt/java:8
2+
3+
COPY build/libs/eessi-pensjon-begrens-innsyn-*.jar /app/app.jar

Jenkinsfile

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/usr/bin/env groovy
2+
@Library('jenkins-pipeline-lib') _
3+
4+
node {
5+
def appToken
6+
def commitHash
7+
try {
8+
cleanWs()
9+
10+
stage("checkout") {
11+
appToken = github.generateAppToken()
12+
13+
sh "git init"
14+
sh "git pull https://x-access-token:$appToken@github.com/navikt/eessi-pensjon-begrens-innsyn.git"
15+
sh "make bump-version"
16+
17+
commitHash = sh(script: "git rev-parse HEAD", returnStdout: true).trim()
18+
github.commitStatus("pending", "navikt/eessi-pensjon-begrens-innsyn", appToken, commitHash)
19+
}
20+
21+
stage("build") {
22+
try {
23+
sh "make"
24+
} catch (e) {
25+
junit('build/test-results/test/**/*.xml')
26+
publishHTML([
27+
allowMissing : false,
28+
alwaysLinkToLastBuild: false,
29+
keepAll : true,
30+
reportDir : 'build/reports/tests/test',
31+
reportFiles : 'index.html',
32+
reportName : 'HTML Report',
33+
reportTitles : ''
34+
])
35+
36+
throw e
37+
}
38+
}
39+
stage("release") {
40+
withCredentials([usernamePassword(credentialsId: 'nexusUploader', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) {
41+
sh "docker login -u ${env.NEXUS_USERNAME} -p ${env.NEXUS_PASSWORD} repo.adeo.no:5443"
42+
}
43+
sh "make release"
44+
sh "git push --tags https://x-access-token:$appToken@github.com/navikt/eessi-pensjon-begrens-innsyn HEAD:master"
45+
}
46+
47+
stage("upload manifest") {
48+
withCredentials([usernamePassword(credentialsId: 'nexusUploader', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) {
49+
sh "make manifest"
50+
}
51+
}
52+
53+
stage("deploy T8") {
54+
def version = sh(script: 'git describe --abbrev=0', returnStdout: true).trim()
55+
build([
56+
job : 'nais-deploy-pipeline',
57+
wait : true,
58+
parameters: [
59+
string(name: 'APP', value: "eessi-pensjon-begrens-innsyn"),
60+
string(name: 'REPO', value: "navikt/eessi-pensjon-begrens-innsyn"),
61+
string(name: 'VERSION', value: version),
62+
string(name: 'DEPLOY_REF', value: version),
63+
string(name: 'NAMESPACE', value: 't8'),
64+
string(name: 'DEPLOY_ENV', value: 't8')
65+
]
66+
])
67+
}
68+
69+
stage("deploy Q1") {
70+
def version = sh(script: 'git describe --abbrev=0', returnStdout: true).trim()
71+
build([
72+
job : 'nais-deploy-pipeline',
73+
wait : true,
74+
parameters: [
75+
string(name: 'APP', value: "eessi-pensjon-begrens-innsyn"),
76+
string(name: 'REPO', value: "navikt/eessi-pensjon-begrens-innsyn"),
77+
string(name: 'VERSION', value: version),
78+
string(name: 'DEPLOY_REF', value: version),
79+
string(name: 'NAMESPACE', value: 'q1'),
80+
string(name: 'DEPLOY_ENV', value: 'q1')
81+
]
82+
])
83+
}
84+
85+
stage("deploy Q2") {
86+
def version = sh(script: 'git describe --abbrev=0', returnStdout: true).trim()
87+
build([
88+
job : 'nais-deploy-pipeline',
89+
wait : true,
90+
parameters: [
91+
string(name: 'APP', value: "eessi-pensjon-begrens-innsyn"),
92+
string(name: 'REPO', value: "navikt/eessi-pensjon-begrens-innsyn"),
93+
string(name: 'VERSION', value: version),
94+
string(name: 'DEPLOY_REF', value: version),
95+
string(name: 'NAMESPACE', value: 'q2'),
96+
string(name: 'DEPLOY_ENV', value: 'q2')
97+
]
98+
])
99+
}
100+
101+
github.commitStatus("success", "navikt/eessi-pensjon-begrens-innsyn", appToken, commitHash)
102+
} catch (err) {
103+
github.commitStatus("failure", "navikt/eessi-pensjon-begrens-innsyn", appToken, commitHash)
104+
throw err
105+
}
106+
}

LICENSE

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

Makefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
DOCKER := docker
2+
GRADLE := ./gradlew
3+
NAIS := nais
4+
GIT := git
5+
VERSION := $(shell cat ./VERSION)
6+
REGISTRY:= repo.adeo.no:5443
7+
8+
.PHONY: all build test docker docker-push bump-version release manifest
9+
10+
all: build test docker
11+
release: tag docker-push
12+
13+
build:
14+
$(GRADLE) assemble
15+
16+
test:
17+
$(GRADLE) test -i
18+
19+
docker:
20+
$(NAIS) validate
21+
$(DOCKER) build --pull -t $(REGISTRY)/eessi-pensjon-begrens-innsyn .
22+
23+
docker-push:
24+
$(DOCKER) tag $(REGISTRY)/eessi-pensjon-begrens-innsyn $(REGISTRY)/eessi-pensjon-begrens-innsyn:$(VERSION)
25+
$(DOCKER) push $(REGISTRY)/eessi-pensjon-begrens-innsyn:$(VERSION)
26+
27+
bump-version:
28+
@echo $$(($$(cat ./VERSION) + 1)) > ./VERSION
29+
30+
tag:
31+
git add VERSION
32+
git commit -m "Bump version to $(VERSION) [skip ci]"
33+
git tag -a $(VERSION) -m "auto-tag from Makefile"
34+
35+
manifest:
36+
$(NAIS) upload --app eessi-pensjon-begrens-innsyn -v $(VERSION)

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2

build.gradle

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
buildscript {
2+
3+
ext {
4+
kotlinVersion = '1.3.41'
5+
springBootVersion = '2.1.6.RELEASE'
6+
cxfVersion = '3.3.2'
7+
oidcTokenSupportVersion = '0.2.9'
8+
logstashLogbackVersion = '6.1'
9+
pensjonInformasjonVersion = '9.4.10'
10+
personV3Version = '3.6.1'
11+
}
12+
repositories {
13+
maven {
14+
url "https://plugins.gradle.org/m2/"
15+
}
16+
maven {
17+
url "https://repo.adeo.no/repository/maven-central"
18+
}
19+
}
20+
21+
dependencies {
22+
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
23+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
24+
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
25+
classpath("gradle.plugin.org.openrepose:gradle-jaxb-plugin:2.5.0")
26+
}
27+
}
28+
29+
plugins {
30+
id 'se.patrikerdes.use-latest-versions' version '0.2.12'
31+
id 'com.github.ben-manes.versions' version '0.21.0'
32+
id "org.owasp.dependencycheck" version "5.2.0"
33+
id "org.sonarqube" version "2.7.1"
34+
id 'jacoco'
35+
}
36+
37+
apply plugin: 'kotlin'
38+
apply plugin: 'kotlin-spring'
39+
apply plugin: 'org.springframework.boot'
40+
apply plugin: 'io.spring.dependency-management'
41+
apply plugin: 'org.openrepose.gradle.plugins.jaxb'
42+
43+
group = 'no.nav.eessi.pensjon'
44+
version = '0.0.1-SNAPSHOT'
45+
46+
configurations {
47+
xsd
48+
}
49+
50+
dependencies {
51+
52+
// Spring-boot
53+
implementation("org.springframework.boot:spring-boot-starter-aop")
54+
implementation("org.springframework.boot:spring-boot-starter-web")
55+
implementation("org.springframework.boot:spring-boot-starter-actuator")
56+
implementation("org.springframework.boot:spring-boot-actuator")
57+
58+
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
59+
implementation 'org.jetbrains.kotlin:kotlin-reflect'
60+
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
61+
implementation 'org.springframework.kafka:spring-kafka'
62+
testImplementation('org.springframework.boot:spring-boot-starter-test') {
63+
exclude module: 'junit'
64+
exclude module: "mockito-core"
65+
}
66+
testImplementation 'org.springframework.kafka:spring-kafka-test'
67+
testCompileOnly('junit:junit:4.12') {
68+
because "spring-kafka-test needs it - but we should not use it in our code"
69+
}
70+
71+
// OIDC
72+
implementation("no.nav.security:oidc-spring-support:0.2.18")
73+
implementation("no.nav.security:oidc-test-support:0.2.18")
74+
75+
// Apache CXF
76+
implementation("org.apache.cxf:cxf-spring-boot-starter-jaxws:${cxfVersion}")
77+
implementation("org.apache.cxf:cxf-rt-ws-security:${cxfVersion}")
78+
implementation("commons-io:commons-io:2.6")
79+
80+
// Allows for variable expiration-date of each cache-entry
81+
implementation("net.jodah:expiringmap:0.5.9")
82+
83+
//mock - test
84+
testImplementation("org.junit.jupiter:junit-jupiter:5.5.1")
85+
testImplementation("org.junit.jupiter:junit-jupiter-params:5.5.1")
86+
testImplementation('org.mockito:mockito-junit-jupiter:2.23.0')
87+
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
88+
testImplementation("org.mock-server:mockserver-netty:5.4.1") {
89+
exclude module: 'junit'
90+
}
91+
testImplementation("org.mock-server:mockserver-client-java:5.4.1")
92+
testImplementation "io.mockk:mockk:1.9.2"
93+
94+
// Architecture tests
95+
testImplementation 'com.tngtech.archunit:archunit:0.11.0'
96+
97+
// Micrometer
98+
implementation("io.micrometer:micrometer-registry-prometheus")
99+
100+
// Tjenestespesifikasjoner
101+
implementation("no.nav.tjenester:nav-person-v3-tjenestespesifikasjon:${personV3Version}")
102+
xsd("no.nav.pensjon:pensjonsinformasjon-xsd:${pensjonInformasjonVersion}")
103+
104+
// PDF box
105+
implementation("org.apache.pdfbox:pdfbox-tools:2.0.13")
106+
implementation("com.twelvemonkeys.imageio:imageio-jpeg:3.1.1")
107+
implementation("com.twelvemonkeys.imageio:imageio-tiff:3.1.1")
108+
109+
// Logging
110+
implementation("net.logstash.logback:logstash-logback-encoder:${logstashLogbackVersion}")
111+
configurations { all*.exclude group: 'commons-logging', module: 'commons-logging' }
112+
implementation group: 'org.slf4j', name: 'jcl-over-slf4j'
113+
114+
}
115+
116+
test {
117+
useJUnitPlatform()
118+
}
119+
120+
compileKotlin {
121+
kotlinOptions {
122+
freeCompilerArgs = ["-Xjsr305=strict"]
123+
jvmTarget = "1.8"
124+
}
125+
}
126+
127+
compileTestKotlin {
128+
kotlinOptions {
129+
freeCompilerArgs = ['-Xjsr305=strict']
130+
jvmTarget = '1.8'
131+
}
132+
}
133+
134+
repositories {
135+
maven {
136+
url "https://repo.adeo.no/repository/maven-central"
137+
}
138+
maven {
139+
url "https://repo.adeo.no/repository/maven-releases"
140+
}
141+
}
142+
143+
wrapper {
144+
distributionType = Wrapper.DistributionType.ALL
145+
}
146+
147+
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
148+
jacoco {
149+
toolVersion = "0.8.4"
150+
}
151+
152+
jacocoTestReport {
153+
reports {
154+
xml.enabled true
155+
}
156+
}
157+
158+
tasks.sonarqube.dependsOn jacocoTestReport
159+
160+
/* https://github.com/ben-manes/gradle-versions-plugin */
161+
dependencyUpdates {
162+
resolutionStrategy() {
163+
componentSelection { rules ->
164+
rules.all { ComponentSelection selection ->
165+
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'pr'].any { qualifier ->
166+
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
167+
}
168+
if (rejected) {
169+
selection.reject('Not a real release')
170+
}
171+
}
172+
}
173+
}
174+
revision = 'release'
175+
}

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.5.1-all.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)