Skip to content

Commit 7db8ac9

Browse files
committed
clean up build
prepare for Circle CI builds add readme badges
1 parent 8ad5719 commit 7db8ac9

10 files changed

Lines changed: 84 additions & 38 deletions

File tree

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2016-2018 Jayson Minard (jayson.minard@gmail.com) and Kohesive
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![GitHub release](https://img.shields.io/github/release/kohesive/elasticsearch-data-import-handler.svg)](https://github.com/kohesive/elasticsearch-data-import-handler/releases) [![CircleCI branch](https://img.shields.io/circleci/project/kohesive/elasticsearch-data-import-handler/master.svg)](https://circleci.com/gh/kohesive/elasticsearch-data-import-handler/tree/master) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/kohesive/elasticsearch-data-import-handler/blob/master/LICENSE) [![ES](https://img.shields.io/badge/ES-5.x-orange.svg)](https://github.com/elastic/elasticsearch) [![ES](https://img.shields.io/badge/ES-6.x-orange.svg)](https://github.com/elastic/elasticsearch)
2+
3+
4+
# Elasticsearch Data Import Handler
15
# Elasticsearch/Algolia Data Import Handler
26

37
A data import handler for Elasticsearch/Algolia

build.gradle

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
plugins {
2-
id 'nebula.kotlin' version '1.1.2' apply false
3-
id 'nebula.facet' version '3.3.0' apply false
4-
id 'nebula.dependency-lock' version '4.9.4' apply false
5-
id 'nebula.resolution-rules' version '2.5.10' apply false
2+
id 'nebula.kotlin' version '1.1.61' apply false
3+
id 'nebula.resolution-rules' version '5.1.1' apply false
64
}
75

86
apply plugin: 'nebula.kotlin'
97
apply plugin: 'nebula.resolution-rules'
10-
apply plugin: 'nebula.dependency-lock'
11-
apply plugin: 'nebula.facet'
128
apply plugin: 'java'
139
apply plugin: 'idea'
1410

@@ -21,10 +17,10 @@ sourceCompatibility = JavaVersion.VERSION_1_8
2117
targetCompatibility = JavaVersion.VERSION_1_8
2218

2319
dependencies {
24-
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jre8'
25-
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
20+
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jre8', version: version_kotlin
21+
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: version_kotlin
2622

27-
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: version_jackson_compatible_with_spark
23+
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: version_jackson_kotlin_module
2824
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: version_jackson_compatible_with_spark
2925
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: version_jackson_compatible_with_spark
3026

@@ -33,7 +29,7 @@ dependencies {
3329
compile group: 'org.elasticsearch', name: "elasticsearch-spark-20_${version_scala}", version: version_elasticsearch
3430
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: version_okhttp
3531

36-
compile group: 'org.apache.spark', name: "spark-sql_${version_scala}", version: '2.1.0'
32+
compile group: 'org.apache.spark', name: "spark-sql_${version_scala}", version: version_spark
3733

3834
compile group: 'org.jsoup', name: 'jsoup', version: version_jsoup
3935

@@ -54,6 +50,7 @@ dependencies {
5450

5551
testCompile group: 'junit', name: 'junit', version: version_junit
5652
testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit'
53+
5754
}
5855

5956
nebulaResolutionRules {
@@ -62,9 +59,6 @@ nebulaResolutionRules {
6259

6360
repositories {
6461
mavenCentral()
65-
maven {
66-
url "http://dl.bintray.com/kotlin/kotlin-eap-1.1"
67-
}
6862
}
6963

7064
compileKotlin {

circle.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Java Gradle CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-java/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# specify the version you desire here
10+
- image: circleci/openjdk:8-jdk
11+
12+
# Specify service dependencies here if necessary
13+
# CircleCI maintains a library of pre-built images
14+
# documented at https://circleci.com/docs/2.0/circleci-images/
15+
# - image: circleci/postgres:9.4
16+
17+
working_directory: ~/repo
18+
19+
environment:
20+
# Customize the JVM maximum heap limit
21+
JVM_OPTS: -Xmx3200m
22+
TERM: dumb
23+
24+
steps:
25+
- checkout
26+
27+
# Download and cache dependencies
28+
- restore_cache:
29+
keys:
30+
- v1-dependencies-{{ checksum "build.gradle" }}
31+
# fallback to using the latest cache if no exact match is found
32+
- v1-dependencies-
33+
34+
- run: gradle dependencies
35+
36+
- save_cache:
37+
paths:
38+
- ~/.gradle
39+
key: v1-dependencies-{{ checksum "build.gradle" }}
40+
41+
# run tests!
42+
- run: ./gradlew clean build test -x signArchives

gradle.properties

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
group = uy.kohesive.elasticsearch
22
version = 0.20.3-ALPHA
33

4-
version_gradle=3.5
5-
version_kotlin=1.1.2
4+
version_gradle=4.5.1
5+
version_kotlin=1.1.61
66

7-
version_nebula_resolution=0.46.0
7+
version_nebula_resolution=0.52.0
88
version_jackson_compatible_with_spark=2.6.7
9-
version_spark=2.1.1
9+
version_jackson_kotlin_module=2.6.7
10+
version_spark=2.2.1
1011

1112
version_typesafe_config=1.3.1
1213

13-
version_elasticsearch=5.4.0
14-
version_okhttp=3.6.0
14+
version_elasticsearch=5.6.7
15+
version_okhttp=3.10.0
1516
version_scala=2.11
1617

1718
version_jsoup=1.10.2
1819

19-
version_slf4j=1.+
20-
version_logback=1.+
21-
version_junit=4.+
20+
version_slf4j=1.7.+
21+
version_logback=1.2.+
22+
version_junit=4.12
2223

2324
version_jdbc_mysql=5.1.41
2425
version_jdbc_postresql=42.0.0

gradle/wrapper/gradle-wrapper.jar

556 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun May 14 14:02:57 UYT 2017
1+
#Sun Feb 25 15:56:41 CST 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip

settings.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
pluginRepositories {
2-
maven {
3-
url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
4-
}
5-
gradlePluginPortal()
6-
}
7-
81
rootProject.name = 'kohesive-elasticsearch-data-import-handler'

src/main/kotlin/uy/kohesive/elasticsearch/dataimport/MicroEsClient.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package uy.kohesive.elasticsearch.dataimport
22

33
import com.fasterxml.jackson.module.kotlin.readValue
44
import okhttp3.*
5-
import okhttp3.internal.http.HttpHeaders
65

76
/**
87
* TODO: Change to use RestClient from ES / Spark integration
@@ -30,37 +29,37 @@ class MicroEsClient(nodes: List<String>, port: Int = 9200, enableSsl: Boolean =
3029
private fun OkHttpClient.get(url: String): CallResponse {
3130
val request = Request.Builder().url(url).build()
3231
val response = http.newCall(request).execute()
33-
return CallResponse(response.code(), response.use { it.body().string() })
32+
return CallResponse(response.code(), response.use { it.body()?.string() ?: "" })
3433
}
3534

3635
private fun OkHttpClient.delete(url: String): CallResponse {
3736
val request = Request.Builder().url(url).delete().build()
3837
val response = http.newCall(request).execute()
39-
return CallResponse(response.code(), response.use { it.body().string() })
38+
return CallResponse(response.code(), response.use { it.body()?.string() ?: "" })
4039
}
4140

4241
private fun OkHttpClient.delete(url: String, jsonBody: String): CallResponse {
4342
val jsonMediaType = MediaType.parse("application/json; charset=utf-8")
4443
val body = RequestBody.create(jsonMediaType, jsonBody)
4544
val request = Request.Builder().url(url).delete(body).build()
4645
val response = http.newCall(request).execute()
47-
return CallResponse(response.code(), response.use { it.body().string() })
46+
return CallResponse(response.code(), response.use { it.body()?.string() ?: "" })
4847
}
4948

5049
private fun OkHttpClient.post(url: String, jsonBody: String): CallResponse {
5150
val jsonMediaType = MediaType.parse("application/json; charset=utf-8")
5251
val body = RequestBody.create(jsonMediaType, jsonBody)
5352
val request = Request.Builder().url(url).post(body).build()
5453
val response = http.newCall(request).execute()
55-
return CallResponse(response.code(), response.use { it.body().string() })
54+
return CallResponse(response.code(), response.use { it.body()?.string() ?: "" })
5655
}
5756

5857
private fun OkHttpClient.put(url: String, jsonBody: String): CallResponse {
5958
val jsonMediaType = MediaType.parse("application/json; charset=utf-8")
6059
val body = RequestBody.create(jsonMediaType, jsonBody)
6160
val request = Request.Builder().url(url).put(body).build()
6261
val response = http.newCall(request).execute()
63-
return CallResponse(response.code(), response.use { it.body().string() })
62+
return CallResponse(response.code(), response.use { it.body()?.string() ?: "" })
6463
}
6564

6665
fun indexTypePOST(indexName: String, indexType: String, restOfUrl: String, postJson: String): CallResponse {

src/test/kotlin/uy/kohesive/elasticsearch/dataimport/ManualTestOfDataImport.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ class ManualTestOfDataImport {
1111
App().run(confFile.inputStream(), confFile.parentFile)
1212
}
1313
}
14-
}
14+
}

0 commit comments

Comments
 (0)