Skip to content

Commit

Permalink
update everything (#42)
Browse files Browse the repository at this point in the history
* wip: update everything, move some stuff around

* remove utils file

* specify java version, only run tests

* fix pdf/a tests

* close document after saving

* fixed tests :)

* remove deployments

* improves embedded font logic

* bump versions, lint, etc.

* enable pdfa validation when disablePdfGet is disabled

* remove svg-support for pdf/a-support, use html-string instead of w3cdocument

* remove test that doesn't work
  • Loading branch information
chinatsu authored Feb 17, 2021
1 parent 5d5bad6 commit d8888bc
Show file tree
Hide file tree
Showing 37 changed files with 3,513 additions and 1,059 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.{kt,kts}]
indent_size=4
insert_final_newline=true
disabled_rules=no-wildcard-imports
24 changes: 0 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,3 @@ jobs:
docker push ${DOCKERHUB_IMAGE}:latest
docker push ${DOCKERHUB_IMAGE}:${GITHUB_SHA}
docker push ${DOCKERHUB_IMAGE}:${version}
deployDev:
name: Deploy to dev
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: naiserator.yaml

deployProd:
name: Deploy to prod
needs: [build, deployDev]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-fss
RESOURCE: naiserator.yaml
22 changes: 7 additions & 15 deletions .github/workflows/devdeploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to dev
name: Run tests
on:
push:
branches:
Expand All @@ -9,11 +9,16 @@ env:

jobs:
build:
name: Checkout code and create docker tag
name: Checkout code and run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Set up Java 14
uses: actions/setup-java@v1
with:
java-version: '14'
architecture: x64
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
Expand All @@ -38,16 +43,3 @@ jobs:
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew shadowJar -x test
- name: Build and publish Docker image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker build --tag ${IMAGE} .
docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY} -p ${GITHUB_TOKEN}
docker push ${IMAGE}
- name: Deploy to Preprod
uses: nais/deploy/actions/deploy@master
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: naiserator.yaml
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM navikt/java:11
COPY build/libs/pdfgen-*-all.jar app.jar
FROM navikt/java:14
COPY build/libs/pdfgen-1.3.1-all.jar app.jar
COPY fonts fonts
COPY templates templates
COPY resources resources
ENV JAVA_OPTS='-Dlogback.configurationFile=logback-remote.xml'
ENV DISABLE_PDF_GET="true"
ENV DISABLE_PDF_GET="true"
44 changes: 23 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "no.nav.pdfgen"
version = "1.2.1"
version = "1.3.1"

val handlebarsVersion = "4.1.2"
val jacksonVersion = "2.9.8"
val jaxbVersion = "2.3.1"
val jsoupVersion = "1.11.3"
val kluentVersion = "1.49"
val ktorVersion = "1.2.6"
val handlebarsVersion = "4.2.0"
val jacksonVersion = "2.12.0"
val jaxbVersion = "3.0.0"
val jaxbApiVersion = "2.3.1"
val jsoupVersion = "1.13.1"
val kluentVersion = "1.65"
val ktorVersion = "1.5.1"
val logbackVersion = "1.2.3"
val logstashEncoderVersion = "5.2"
val openHtmlToPdfVersion = "0.0.1-RC17"
val prometheusVersion = "0.6.0"
val spekVersion = "2.0.9"
val verapdfVersion = "1.12.1"
val logstashEncoderVersion = "6.6"
val openHtmlToPdfVersion = "1.0.6"
val prometheusVersion = "0.10.0"
val spekVersion = "2.0.15"
val verapdfVersion = "1.16.1"

plugins {
kotlin("jvm") version "1.3.71"
id("org.jmailen.kotlinter") version "2.2.0"
kotlin("jvm") version "1.4.30"
id("org.jmailen.kotlinter") version "3.3.0"
id("com.github.johnrengelman.shadow") version "5.2.0"
id("com.github.ben-manes.versions") version "0.21.0"
}
Expand All @@ -39,7 +40,7 @@ tasks {
}
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "14"
}
withType<Jar> {
manifest.attributes("Main-Class" to "no.nav.pdfgen.BootstrapKt")
Expand All @@ -49,31 +50,33 @@ tasks {
repositories {
mavenCentral()
jcenter()
maven(url="https://dl.bintray.com/kotlin/ktor")
maven(url= "https://dl.bintray.com/spekframework/spek-dev")
maven(url = "https://dl.bintray.com/kotlin/ktor")
maven(url = "https://dl.bintray.com/spekframework/spek-dev")
}

dependencies {
compile(kotlin("stdlib"))
implementation("org.jetbrains.kotlin:kotlin-stdlib")

implementation("com.github.jknack:handlebars:$handlebarsVersion")
implementation("com.github.jknack:handlebars-jackson2:$handlebarsVersion")
implementation("com.openhtmltopdf:openhtmltopdf-pdfbox:$openHtmlToPdfVersion")
implementation("com.openhtmltopdf:openhtmltopdf-slf4j:$openHtmlToPdfVersion")
implementation("com.openhtmltopdf:openhtmltopdf-svg-support:$openHtmlToPdfVersion")
// implementation("com.openhtmltopdf:openhtmltopdf-svg-support:$openHtmlToPdfVersion")

implementation("org.jsoup:jsoup:$jsoupVersion")
implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("javax.xml.bind:jaxb-api:2.1")
implementation("javax.xml.bind:jaxb-api:$jaxbApiVersion")
implementation("org.glassfish.jaxb:jaxb-runtime:$jaxbVersion")

implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-jackson:$ktorVersion")
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")

implementation("org.verapdf:validation-model:$verapdfVersion")

implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")

Expand All @@ -82,6 +85,5 @@ dependencies {
testRuntimeOnly("org.spekframework.spek2:spek-runtime-jvm:$spekVersion")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion")

testImplementation("org.verapdf:validation-model:$verapdfVersion")
testImplementation("io.ktor:ktor-client-cio:$ktorVersion")
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "pdfgen"
rootProject.name = "pdfgen"
Loading

0 comments on commit d8888bc

Please sign in to comment.