Skip to content

Commit

Permalink
Sink connector productization (#16)
Browse files Browse the repository at this point in the history
* Updated build scripts
* Code refactoring and stability fixes
* Added automated integration testing
* Updated documentation
* Packages available from download pages
  • Loading branch information
bczoma authored Apr 24, 2020
1 parent 9a8690d commit b904f7e
Show file tree
Hide file tree
Showing 65 changed files with 2,195 additions and 2,173 deletions.
801 changes: 0 additions & 801 deletions .README.md.html

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tmp/**/*
*~.nib
local.properties
.classpath
.settings/
.settings
.loadpath
.checkstyle

Expand All @@ -35,3 +35,7 @@ local.properties

# Locally stored "Eclipse launch configurations"
*.launch
/build/

# Unzipped test connector
src/integrationTest/resources/pubsubplus-connector-kafka*/
26 changes: 24 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
language: java
install: true

sudo: required
services:
- docker
jdk:
- openjdk8

script:
- ./gradlew clean check jar
- ./gradlew clean integrationTest --tests com.solace.connector.kafka.connect.sink.it.SinkConnectorIT

after_success:
- >
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
git config --global user.email "[email protected]";
git config --global user.name "travis-ci";
mkdir gh-pages; # Now update gh-pages
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/SolaceProducts/pubsubplus-connector-kafka-sink gh-pages > /dev/null 2>&1;
rm gh-pages/downloads/pubsubplus-connector-kafka-sink*
mv build/distributions/pubsubplus-connector-kafka-sink* gh-pages/downloads
cd gh-pages;
pushd downloads
cp index.template index.html; FILENAME=`find . | grep *.zip | cut -d'/' -f2 | sed 's/.\{4\}$//'`; sed -i "s/CONNECTOR_NAME/$FILENAME/g" index.html;
popd;
git add -f .;
git commit -m "Latest connector distribution on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages";
git remote add origin-pages https://${GH_TOKEN}@github.com/SolaceProducts/pubsubplus-connector-kafka-sink.git > /dev/null 2>&1;
git push --quiet --set-upstream origin-pages gh-pages;
echo "Updated and pushed GH pages!";
fi
409 changes: 235 additions & 174 deletions README.md

Large diffs are not rendered by default.

152 changes: 64 additions & 88 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,110 +1,86 @@
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* user guapply plugin: e available at https://docs.gradle.org/3.5/userguapply plugin: e/java_library_plugin.html
*/

// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'jacoco'
//apply plugin: 'net.researchgate.release' version '2.4.0'
//apply plugin: "com.jfrog.bintray" version '1.7'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'distribution'
apply plugin: 'org.unbroken-dome.test-sets'

ext {
//kafkaVersion = '0.10.0.0'
//kafkaVersion = '0.11.0.0'
//kafkaVersion = '1.1.0'
kafkaVersion = '2.0.0'
kafkaVersion = '2.4.1'
solaceJavaAPIVersion = '10.6.0'
}

// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenLocal()
mavenCentral()
}

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:21.0'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.spotbugs:spotbugs-gradle-plugin:3.0.0"
classpath "org.unbroken-dome.test-sets:org.unbroken-dome.test-sets.gradle.plugin:2.2.1"
}
}

// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()

maven { url "https://mvnrepository.com/artifact/com.solacesystems/sol-jcsmp" }
// https://mvnrepository.com/artifact/com.solacesystems/sol-jcsmp


testSets {
integrationTest
}

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
//api 'org.apache.commons:commons-math3:3.6.1'

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:21.0'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'

testCompile group: 'junit', name: 'junit', version: '4.12'
integrationTestImplementation 'junit:junit:4.12'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
integrationTestImplementation 'org.junit.platform:junit-platform-engine:1.5.2'
integrationTestImplementation 'org.mockito:mockito-core:3.2.4'
integrationTestImplementation 'org.mockito:mockito-junit-jupiter:3.2.4'
integrationTestImplementation 'org.testcontainers:testcontainers:1.12.4'
integrationTestImplementation 'org.testcontainers:junit-jupiter:1.12.4'
integrationTestImplementation 'org.slf4j:slf4j-api:1.7.28'
integrationTestImplementation 'org.slf4j:slf4j-simple:1.7.28'
integrationTestImplementation 'org.apache.commons:commons-configuration2:2.6'
integrationTestImplementation 'commons-beanutils:commons-beanutils:1.9.4'
integrationTestImplementation 'com.google.code.gson:gson:2.3.1'
integrationTestImplementation 'commons-io:commons-io:2.4'
integrationTestImplementation 'com.squareup.okhttp3:okhttp:4.4.0'
integrationTestImplementation 'org.apache.kafka:kafka-clients:$kafkaVersion'
compile "org.apache.kafka:connect-api:$kafkaVersion"
compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
compile 'org.bouncycastle:bcprov-jdk15on:1.54'
compile 'org.bouncycastle:bcpkix-jdk15on:1.54'
compile 'org.bouncycastle:bcpg-jdk15on:1.54'
compile 'commons-io:commons-io:2.4'
compile 'org.slf4j:slf4j-api:1.7.14'
testCompile 'org.slf4j:slf4j-simple:1.7.14'
compile group: 'com.solacesystems', name: 'sol-jcsmp', version: '10.4.0'
//compile 'com.puppycrawl.tools:checkstyle:8.12'
compile "com.solacesystems:sol-jcsmp:$solaceJavaAPIVersion"
}

tasks.withType(FindBugs) {
reports {
xml.enabled = true
html.enabled = false
task('prepDistForIntegrationTesting') {
dependsOn assembleDist
doLast {
copy {
from zipTree(file('build/distributions').listFiles().findAll {it.name.endsWith('.zip')}[0])
into (file('src/integrationTest/resources'))
}
copy {
from zipTree(file('build/distributions').listFiles().findAll {it.name.endsWith('.zip')}[0])
into (file('build/resources/integrationTest'))
}
}
}

task copyRuntimeLibs(type: Copy) {
into "$buildDir/output/lib"
from configurations.runtime
project.integrationTest {
useJUnitPlatform()
outputs.upToDateWhen { false }
dependsOn prepDistForIntegrationTesting
}

checkstyle {
repositories {
mavenCentral()
}
configurations {
checkstyle
distributions {
main {
contents {
from('etc/solace_sink.properties') { into 'etc' }
from('etc/solace_sink_properties.json') { into 'etc' }
from('doc/distribution-readme.md') { into 'doc' }
from('LICENSE') { into 'doc' }
into('lib') {
from jar
from(project.configurations.runtime)
}
// from jar
}
}
dependencies {
//checkstyle 'com.puppycrawl.tools:checkstyle:6.12.1'
checkstyle 'com.puppycrawl.tools:checkstyle:8.12'

}
}

processResources {
expand project.properties
}
Loading

0 comments on commit b904f7e

Please sign in to comment.