Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CityVizor SVG chart generator #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM gradle:6.4.1-jdk11 as gradle
FROM gradle:6.1.1-jdk11 as gradle

COPY . /home/gradle/server
WORKDIR /home/gradle/server
RUN gradle build -x test
RUN gradle build

FROM openjdk:alpine
FROM openjdk:11.0.1
WORKDIR /home/server-kotlin
COPY --from=gradle /home/gradle/server/build/libs/server-0.0.5.jar /home/server-kotlin/
COPY --from=gradle /home/gradle/server/build/distributions /home/server-kotlin/

CMD ["java", "-jar", "-Xmx128m", "/home/server-kotlin/server-0.0.5.jar"]
COPY start_last_local.sh /home/scripts/start_last_local.sh

CMD ["/bin/bash", "-c", "/home/scripts/start_last_local.sh"]
115 changes: 51 additions & 64 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,89 +1,76 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

plugins {
id 'org.springframework.boot' version "2.3.4.RELEASE"
id 'io.spring.dependency-management' version "1.0.10.RELEASE"
id 'org.jetbrains.kotlin.jvm' version "$kotlin_version"
id 'org.jetbrains.kotlin.plugin.spring' version "$kotlin_version"
id 'com.google.cloud.tools.jib' version '2.2.0'
id 'com.github.ben-manes.versions' version '0.33.0'
id 'org.jlleitschuh.gradle.ktlint' version '9.4.1'
}
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'application'

group 'digital.cesko'
version '0.0.5'
java.sourceCompatibility = JavaVersion.VERSION_11
version '0.0.4'
mainClassName = "io.ktor.server.netty.EngineMain"

sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ['src']
test.kotlin.srcDirs = test.java.srcDirs = ['test']
main.resources.srcDirs = ['resources']
test.resources.srcDirs = ['testresources']
}

repositories {
mavenCentral()
mavenLocal()
jcenter()
maven { url 'https://kotlin.bintray.com/ktor' }
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation("org.springframework.boot:spring-boot-starter-web")
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation "org.jetbrains.exposed:exposed-dao:$exposed_version"
implementation "org.jetbrains.exposed:exposed-jdbc:$exposed_version"
implementation "org.jetbrains.exposed:exposed-java-time:$exposed_version"
implementation "org.postgresql:postgresql"
implementation "io.github.microutils:kotlin-logging:2.0.3"

testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5:$kotlin_version"
testImplementation "com.h2database:h2"
testImplementation "org.awaitility:awaitility"
testImplementation "net.javacrumbs.json-unit:json-unit-spring:2.19.0"
testImplementation "org.testcontainers:postgresql:1.14.3"
testImplementation "net.jadler:jadler-core:1.3.0"
testImplementation "net.jadler:jadler-jdk:1.3.0"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "io.ktor:ktor-server-netty:$ktor_version"
compile "ch.qos.logback:logback-classic:$logback_version"
compile "io.ktor:ktor-server-core:$ktor_version"
compile "io.ktor:ktor-auth:$ktor_version"
compile "io.ktor:ktor-auth-jwt:$ktor_version"
compile "io.ktor:ktor-jackson:$ktor_version"
testCompile "io.ktor:ktor-server-tests:$ktor_version"
compile("io.ktor:ktor-client-json:$ktor_version")
compile "io.ktor:ktor-client-gson:$ktor_version"
compile "io.ktor:ktor-client-core:$ktor_version"
compile "io.ktor:ktor-client-core-jvm:$ktor_version"
compile "io.ktor:ktor-client-apache:$ktor_version"

// google docs API
implementation 'com.google.api-client:google-api-client:1.30.9'
implementation 'com.google.auth:google-auth-library-oauth2-http:0.20.0'
implementation 'com.google.apis:google-api-services-sheets:v4-rev20200508-1.30.9'
compile 'com.google.api-client:google-api-client:1.30.1'
compile 'com.google.auth:google-auth-library-oauth2-http:0.20.0'
compile 'com.google.apis:google-api-services-sheets:v4-rev604-1.25.0'

//Lucene engine (for search)
implementation group: 'org.apache.lucene', name: 'lucene-core', version: "$lucene_version"
implementation group: 'org.apache.lucene', name: 'lucene-queryparser', version: "$lucene_version"
implementation group: 'org.apache.lucene', name: 'lucene-analyzers-common', version: "$lucene_version"
compile group: 'org.apache.lucene', name: 'lucene-core', version: '8.3.0'
compile group: 'org.apache.lucene', name: 'lucene-queryparser', version: '8.3.0'
compile group: 'org.apache.lucene', name: 'lucene-analyzers-common', version: '8.3.0'

// Apache commons-csv for parsing csv files created by Internet Stream
implementation "org.apache.commons:commons-csv:1.8"
}
//Akka actor model
compile group: 'com.typesafe.akka', name: 'akka-actor_2.13', version: '2.6.0'

compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
// SVG DSL
compile "com.github.nwillc:ksvg:2.3.3"

test {
useJUnitPlatform()
afterTest { desc, result ->
logger.quiet "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}


jib {
from {
image = 'openjdk:alpine'
}
to {
image = 'cityvizor/server-kotlin:test'
}

jar {
manifest {
attributes 'Main-Class': "io.ktor.server.netty.EngineMain"
}
container {
jvmFlags = ['-Xmx256m']
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
7 changes: 3 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ktor_version=1.2.6
kotlin.code.style=official
kotlin_version=1.4.10
lucene_version=8.6.2
exposed_version=0.27.1

kotlin_version=1.3.60
logback_version=1.2.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Feb 13 17:44:57 CET 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 0 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -130,7 +129,6 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
4 changes: 0 additions & 4 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand Down Expand Up @@ -84,7 +81,6 @@ set CMD_LINE_ARGS=%*

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

Expand Down
25 changes: 25 additions & 0 deletions resources/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ktor {
deployment {
port = 8080
port = ${?PORT}
}
application {
modules = [ main.ApplicationKt.module ]
}
}

akka {
debug {
lifecycle = on
log-received-messages = on
}
}

app {
city-request {
timeZone: "Europe/Prague"
sheetId: "12SM9gbOlKG2OnplHryuhx9oGAQh3JHGumSZVU7g4Gzo"
listName: "Seznam"
appName: "CityVizor"
}
}
Loading