Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Sep 28, 2018
0 parents commit 2b0f284
Show file tree
Hide file tree
Showing 53 changed files with 3,434 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
### Java
*.class
*.log
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
hs_err_pid*

### Gradle
.gradle/*
build/*
!gradle-wrapper.jar
.gradletasknamecache

### Assets
public/vendor

### Ide ###
.idea/*
.vscode/*
.project/*
.settings/*
out/*

### Log ###
.*.log
.*.log.[0-9]
*.log.[0-9]
logs/*

### Kafka HQ ###
conf/*.dev.conf
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--modules-folder public/vendor
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openjdk:8-jdk as builder
COPY . /app
WORKDIR /app
RUN echo -e 'http://dl-cdn.alpinelinux.org/alpine/edge/main\nhttp://dl-cdn.alpinelinux.org/alpine/edge/community\nhttp://dl-cdn.alpinelinux.org/alpine/edge/testing' > /etc/apk/repositories && \
apk add --no-cache yarn && \
yarn install && \
./gradlew jar


FROM openjdk:8-jre
WORKDIR /app
COPY --from=builder /app/build/libs/kafkahq-*.jar /app/kafkahq.jar
CMD ["/usr/bin/java", "-jar", "/app/kafkahq.jar", "prod"]
91 changes: 91 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
buildscript {
ext {
joobyVersion = "1.5.1"
}

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
classpath "com.google.gradle:osdetector-gradle-plugin:1.4.0"
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
classpath "org.jooby:jooby-gradle-plugin:$joobyVersion"
}
}

apply plugin: "io.spring.dependency-management"
apply plugin: "com.google.osdetector"
apply plugin: "application"
apply plugin: "jooby"
apply plugin: "idea"

group 'org.kafkahq'
version '0.1'
mainClassName = "org.kafkahq.App"
sourceCompatibility = 1.8

repositories {
mavenLocal()
mavenCentral()
}

dependencyManagement {
imports {
mavenBom "org.jooby:jooby-bom:$joobyVersion"
}
}

idea {
module {
downloadJavadoc = false
downloadSources = true
}
}

joobyRun {
includes = ['**/*.class', '**/*.conf', '**/*.properties', '**/*.ftl', '**/*.xml']
}


dependencies {
// jooby
compile "org.jooby:jooby-netty"
compile "io.netty:netty-transport-native-epoll:${dependencyManagement.importedProperties['netty.version']}:${osdetector.classifier.contains('linux') ? 'linux-x86_64' : ''}"
compile "io.netty:netty-tcnative-boringssl-static:${dependencyManagement.importedProperties['boringssl.version']}"
compile group: 'org.jooby', name: 'jooby-assets', version: joobyVersion
compile group: 'org.jooby', name: 'jooby-assets-sass', version: joobyVersion
compile group: 'org.jooby', name: 'jooby-livereload', version: joobyVersion
// compile group: 'org.jooby', name: 'jooby-assets-auto-prefixer', version: joobyVersion
// compile group: 'org.jooby', name: 'jooby-assets-clean-css', version: joobyVersion
// compile group: 'org.jooby', name: 'jooby-assets-uglify', version: joobyVersion
compile group: 'org.jooby', name: 'jooby-jackson', version: joobyVersion
compile group: 'org.jooby', name: 'jooby-ftl', version: joobyVersion
compile group: 'org.jooby', name: 'jooby-whoops', version: joobyVersion

// kafka
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '2.0.+'

// debug
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.+'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.+'

// test
testCompile "junit:junit:4.12"
testCompile "io.rest-assured:rest-assured:3.1.0"
}

sourceSets.main.resources {
srcDirs = ["conf", "public"]
}

jar {
manifest {
attributes "Main-Class": mainClassName
}

from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
20 changes: 20 additions & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
application {
name: Kafka HQ
charset: UTF-8
port: 8080
port: ${?APPLICATION_PORT}
}

sass {
dev {
sourcemap: inline
}

dist {
style: compressed
}
}


freemarker {
}
32 changes: 32 additions & 0 deletions conf/assets.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
assets {
fileset {
vendor: [
static/vendor.scss

vendor/jquery/dist/jquery.js
vendor/popper.js/dist/umd/popper.js
vendor/bootstrap/dist/js/bootstrap.js
vendor/sweetalert2/dist/sweetalert2.all.js
vendor/turbolinks/dist/turbolinks.js
]

template: [
static/template.scss,
static/template.js
]
}

pipeline {
dev: [sass]
dist: [sass]
}

sass {
dev {
sourcemap: inline
}
dist {
style: compressed
}
}
}
39 changes: 39 additions & 0 deletions conf/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="15 seconds" debug="false">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<immediateFlush>true</immediateFlush>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>DENY</onMatch>
</filter>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>WARN</level>
<onMatch>DENY</onMatch>
</filter>
<encoder>
<pattern>%d{ISO8601} %highlight(%5.5level) %magenta(%-10.10thread) %cyan(%-26.26logger{26}) %msg%n</pattern>
</encoder>
</appender>

<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<immediateFlush>true</immediateFlush>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<encoder>
<pattern>%d{ISO8601} %highlight(%5.5level) %magenta(%-10.10thread) %cyan(%-26.26logger{26}) %msg%n</pattern>
</encoder>
</appender>

<root level="TRACE">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDERR" />
</root>

<logger name="org.apache.kafka" level="WARN" />
<logger name="io.netty" level="WARN" />
<logger name="org.jooby" level="WARN" />
<logger name="org.jooby.RequestLogger" level="INFO" />
</configuration>
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
Loading

0 comments on commit 2b0f284

Please sign in to comment.