-
Notifications
You must be signed in to change notification settings - Fork 51
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
Robin Duda
committed
Oct 28, 2018
1 parent
32e6d7b
commit 8a09481
Showing
8 changed files
with
85 additions
and
48 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,23 @@ | ||
FROM anapsix/alpine-java:latest | ||
|
||
MAINTAINER codingchili@github | ||
|
||
# run mvn clean package to build the jar file. | ||
# to build the docker image run: docker build . | ||
|
||
|
||
RUN mkdir -p /opt/excelastic | ||
COPY docker/configuration.json /opt/excelastic | ||
COPY docker/bootstrap.sh /opt/excelastic | ||
COPY excelastic-*.jar /opt/excelastic/excelastic.jar | ||
RUN chmod +x /opt/excelastic/bootstrap.sh && \ | ||
apk add gettext | ||
|
||
WORKDIR /opt/excelastic | ||
|
||
ENV es_host localhost | ||
ENV es_port 9200 | ||
|
||
EXPOSE 5252:5252/tcp | ||
|
||
ENTRYPOINT ["/bin/sh", "-c", "/opt/excelastic/bootstrap.sh"] |
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 @@ | ||
envsubst < configuration.json > configuration.json && java -jar excelastic.jar |
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,8 @@ | ||
{ | ||
"web_port": 5252, | ||
"elastic_port": $es_port, | ||
"elastic_host": "$es_host", | ||
"elastic_tls": false, | ||
"authentication": false, | ||
"basic": "username:password" | ||
} |
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
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 |
---|---|---|
@@ -1,47 +1,47 @@ | ||
package com.codingchili.Model; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import org.reactivestreams.Publisher; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Robin Duda | ||
* <p> | ||
* Interface used to support different input file formats. | ||
* The parser is subscribable and emits json objects for importing. | ||
*/ | ||
public interface FileParser extends Publisher<JsonObject> { | ||
|
||
/** | ||
* @param localFileName a file on disk to be parsed, do not read this into memory | ||
* as it could be potentially very large. | ||
* @param offset indicates how many empty rows to skip before finding the titles. | ||
* @param fileName the original name of the file to be imported. | ||
*/ | ||
void setFileData(String localFileName, int offset, String fileName) throws FileNotFoundException; | ||
|
||
/** | ||
* @return a set of file extensions that this fileparser supports. | ||
*/ | ||
Set<String> getSupportedFileExtensions(); | ||
|
||
/** | ||
* Parses the excel file to make sure that it is parseable without allocating memory | ||
* for the result. This should be called before importing to make | ||
* sure any imports does not fail halfway through. | ||
*/ | ||
void initialize(); | ||
|
||
/** | ||
* @return the number of elements that was parsed. | ||
*/ | ||
int getNumberOfElements(); | ||
|
||
|
||
/** | ||
* Releases any resources associated with the FileParser. | ||
*/ | ||
void free(); | ||
} | ||
package com.codingchili.Model; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import org.reactivestreams.Publisher; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Robin Duda | ||
* <p> | ||
* Interface used to support different input file formats. | ||
* The parser is subscribable and emits json objects for importing. | ||
*/ | ||
public interface FileParser extends Publisher<JsonObject> { | ||
|
||
/** | ||
* @param localFileName a file on disk to be parsed, do not read this into memory | ||
* as it could be potentially very large. | ||
* @param offset indicates how many empty rows to skip before finding the titles. | ||
* @param fileName the original name of the file to be imported. | ||
*/ | ||
void setFileData(String localFileName, int offset, String fileName) throws FileNotFoundException; | ||
|
||
/** | ||
* @return a set of file extensions that this fileparser supports. | ||
*/ | ||
Set<String> getSupportedFileExtensions(); | ||
|
||
/** | ||
* Parses the excel file to make sure that it is parseable without allocating memory | ||
* for the result. This should be called before importing to make | ||
* sure any imports does not fail halfway through. | ||
*/ | ||
void initialize(); | ||
|
||
/** | ||
* @return the number of elements that was parsed. | ||
*/ | ||
int getNumberOfElements(); | ||
|
||
|
||
/** | ||
* Releases any resources associated with the FileParser. | ||
*/ | ||
void free(); | ||
} |
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