Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21d0990
commit 90c00e3
Showing
15 changed files
with
429 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.git | ||
/out/ | ||
/build/ | ||
/.idea/ | ||
/src/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM openjdk:8-alpine as builder | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
|
||
ENV GRADLE_OPTS -Dorg.gradle.daemon=false -Dorg.gradle.project.profile=docker | ||
|
||
COPY ./gradle/wrapper /code/gradle/wrapper | ||
COPY ./gradlew /code/ | ||
RUN ./gradlew --version | ||
|
||
COPY ./gradle/profile.docker.gradle /code/gradle/ | ||
COPY ./build.gradle ./gradle.properties ./settings.gradle /code/ | ||
|
||
RUN ./gradlew downloadDependencies | ||
|
||
COPY ./src/ /code/src | ||
|
||
RUN ./gradlew jar | ||
|
||
FROM confluentinc/cp-kafka-connect:4.0.0 | ||
|
||
MAINTAINER Nivethika M <nivethika@thehyve.nl> , Joris B <joris@thehyve.nl> | ||
|
||
LABEL description="MongoDB Sink Connector" | ||
|
||
COPY --from=builder /code/build/libs/*.jar /etc/kafka-connect/jars/ | ||
|
||
COPY ./src/main/docker/kafka-wait /usr/bin/kafka-wait | ||
|
||
# Load modified launcher | ||
COPY ./src/main/docker/launch /etc/confluent/docker/launch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apply plugin: 'jacoco' | ||
|
||
configurations { | ||
codacy | ||
} | ||
|
||
// In this section you declare where to find the dependencies of your project | ||
repositories { | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
|
||
dependencies { | ||
codacy 'com.github.codacy:codacy-coverage-reporter:2.0.1' | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.enabled true | ||
csv.enabled false | ||
html.enabled false | ||
} | ||
} | ||
|
||
task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) { | ||
main = 'com.codacy.CodacyCoverageReporter' | ||
classpath = configurations.codacy | ||
args = ['-l', 'Java', '-r', "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apply from: 'gradle/test.gradle' | ||
apply from: 'gradle/style.gradle' | ||
apply from: 'gradle/publishing.gradle' | ||
apply from: 'gradle/codacy.gradle' | ||
|
||
task downloadDependencies(type: Exec) { | ||
configurations.compileClasspath.files | ||
configurations.testRuntimeClasspath.files | ||
configurations.codacy.files | ||
configurations.jacocoAnt.files | ||
commandLine 'echo', 'Downloaded all dependencies' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
task downloadDependencies(type: Exec) { | ||
configurations.compileClasspath.files | ||
configurations.runtimeClasspath.files | ||
commandLine 'echo', 'Downloaded all dependencies' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' | ||
} | ||
} | ||
|
||
apply plugin: 'maven-publish' | ||
apply plugin: 'com.jfrog.bintray' | ||
|
||
def pomConfig = { | ||
licenses { | ||
license { | ||
name "The Apache Software License, Version 2.0" | ||
url "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
distribution "RADAR-CNS Distributions" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id "radar-cns" | ||
name "Nivethika" | ||
email "nivethika@thehyve.nl" | ||
} | ||
} | ||
} | ||
// custom tasks for creating source/javadoc jars | ||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.output | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
// add javadoc/source jar tasks as artifacts | ||
artifacts { | ||
archives sourcesJar, javadocJar | ||
} | ||
|
||
|
||
publishing { | ||
publications { | ||
RadarMongoDBPublication(MavenPublication) { | ||
from components.java | ||
artifact sourcesJar | ||
artifact javadocJar | ||
groupId 'org.radarcns' | ||
artifactId 'kafka-connect-mongodb-sink' | ||
version project.version | ||
pom.withXml { | ||
def root = asNode() | ||
root.appendNode('description', 'The MongoDB sink connector is a tool for scalably and reliably streaming data between Apache Kafka and MongoDB.') | ||
root.appendNode('name', 'kafka-connect-mongodb-sink') | ||
root.appendNode('url', 'https://github.com/RADAR-CNS/MongoDb-Sink-Connector.git') | ||
root.children().last() + pomConfig | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
bintray { | ||
user = System.getenv('BINTRAY_USER') ? System.getenv('BINTRAY_USER') : project.hasProperty('bintrayUser') | ||
key = System.getenv('BINTRAY_API_KEY') ? System.getenv('BINTRAY_API_KEY') : project.hasProperty('bintrayApiKey') | ||
override = false | ||
publications = ['RadarMongoDBPublication'] | ||
pkg { | ||
repo = 'org.radarcns' | ||
name = 'kafka-connect-mongodb-sink' | ||
userOrg = 'radar-cns' | ||
licenses = ['Apache-2.0'] | ||
vcsUrl = 'https://github.com/RADAR-CNS/MongoDb-Sink-Connector.git' | ||
version { | ||
name = project.version | ||
desc = 'Initial alpha release' | ||
vcsTag = System.getenv('TRAVIS_TAG') | ||
released = new Date() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apply plugin: 'pmd' | ||
apply plugin: 'checkstyle' | ||
|
||
checkstyle { | ||
toolVersion '6.16' | ||
} | ||
|
||
pmd { | ||
toolVersion = '5.5.2' | ||
consoleOutput = true | ||
|
||
ruleSets = [] | ||
ruleSetFiles = files("config/pmd/ruleset.xml") | ||
} | ||
|
||
|
||
pmdTest { | ||
ruleSetFiles = files("config/pmd/test_ruleset.xml") | ||
} |
Oops, something went wrong.