Skip to content

Commit

Permalink
added dockerfile, better run.sh, relocated offsets. this fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
simplesteph committed Apr 28, 2017
1 parent 812875b commit 6015618
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
standalone.offsets
target/
.idea/
*.log
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM confluentinc/cp-kafka-connect:3.2.0

WORKDIR /kafka-connect-source-github
COPY config config
COPY target target

CMD connect-standalone config/worker.properties config/GitHubSourceConnectorExample.properties
2 changes: 1 addition & 1 deletion config/worker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ internal.value.converter.schemas.enable=true
rest.port=8086
rest.host.name=127.0.0.1
# this config is only for standalone workers
offset.storage.file.filename=standalone.offsets
offset.storage.file.filename=offsets/standalone.offsets
offset.flush.interval.ms=10000
1 change: 1 addition & 0 deletions offsets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standalone.offsets
9 changes: 4 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
export CLASSPATH="$(find target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
if hash docker 2>/dev/null; then
# for docker lovers
docker build . -t simplesteph/kafka-connect-source-github:1.0
docker run -e CLASSPATH=$CLASSPATH \
--net=host --rm \
-v $(pwd):/kafka-connect-github-source \
-w /kafka-connect-github-source \
confluentinc/cp-kafka-connect:3.2.0 \
connect-standalone config/worker.properties config/GitHubSourceConnectorExample.properties
--net=host --rm -t \
-v $(pwd)/offsets:/kafka-connect-source-github/offsets \
simplesteph/kafka-connect-source-github:1.0
elif hash connect-standalone 2>/dev/null; then
# for mac users who used homebrew
connect-standalone config/worker.properties config/GitHubSourceConnectorExample.properties
Expand Down

0 comments on commit 6015618

Please sign in to comment.