Skip to content

Commit

Permalink
usage of -n option in template list. Fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
hifly81 committed Sep 25, 2024
1 parent 473ecf1 commit af540b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions quickstart/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ RUN CGO_ENABLED=1 GOOS=linux go build -tags static_all -v -ldflags="-X 'github.c
FROM confluentinc/cp-kafka-connect-base:7.7.1

ARG JR_SOURCE_CONNECTOR_VERSION=0.1.0
ARG JR_PACKAGE_NAME=jrndio-jr-kafka-connect-source

COPY --from=builder /tmp/jr-main/templates/ /home/appuser/.jr/templates/
COPY --from=builder /tmp/jr-main/build/jr /bin

ENV JR_SYSTEM_DIR=/home/appuser/.jr

COPY target/jr-kafka-connect-source-${JR_SOURCE_CONNECTOR_VERSION}-package.zip /tmp/jr-kafka-connect-source-${JR_SOURCE_CONNECTOR_VERSION}-package.zip
COPY target/${JR_PACKAGE_NAME}-${JR_SOURCE_CONNECTOR_VERSION}.zip /tmp/${JR_PACKAGE_NAME}-${JR_SOURCE_CONNECTOR_VERSION}.zip

RUN confluent-hub install --no-prompt /tmp/jr-kafka-connect-source-${JR_SOURCE_CONNECTOR_VERSION}-package.zip
RUN confluent-hub install --no-prompt /tmp/${JR_PACKAGE_NAME}-${JR_SOURCE_CONNECTOR_VERSION}.zip
5 changes: 3 additions & 2 deletions quickstart/Dockerfile-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ RUN CGO_ENABLED=1 GOOS=linux go build -tags static_all -v -ldflags="-X 'github.c
FROM confluentinc/cp-kafka-connect-base:7.7.1

ARG JR_SOURCE_CONNECTOR_VERSION=0.1.0
ARG JR_PACKAGE_NAME=jrndio-jr-kafka-connect-source

COPY --from=builder /tmp/jr-main/templates/ /home/appuser/.jr/templates/
COPY --from=builder /tmp/jr-main/build/jr /bin

ENV JR_SYSTEM_DIR=/home/appuser/.jr

COPY target/jr-kafka-connect-source-${JR_SOURCE_CONNECTOR_VERSION}-package.zip /tmp/jr-kafka-connect-source-${JR_SOURCE_CONNECTOR_VERSION}-package.zip
COPY target/${JR_PACKAGE_NAME}-${JR_SOURCE_CONNECTOR_VERSION}.zip /tmp/${JR_PACKAGE_NAME}-${JR_SOURCE_CONNECTOR_VERSION}.zip

RUN confluent-hub install --no-prompt /tmp/jr-kafka-connect-source-${JR_SOURCE_CONNECTOR_VERSION}-package.zip
RUN confluent-hub install --no-prompt /tmp/${JR_PACKAGE_NAME}-${JR_SOURCE_CONNECTOR_VERSION}.zip
2 changes: 2 additions & 0 deletions quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ services:

control-center:
image: confluentinc/cp-enterprise-control-center:7.7.1
hostname: control-center
container_name: control-center
depends_on:
- broker
- schema-registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public List<String> templates() {
}
commandBuilder.append(JR_EXECUTABLE_NAME);
commandBuilder.append(" list");
commandBuilder.append(" -n");

processBuilder.command(
CommandInterpeter.getInstance().getCommand(),
Expand All @@ -71,9 +72,8 @@ public List<String> templates() {
String line;
while ((line = reader.readLine()) != null) {
String tmpLine = line.trim();
if(!tmpLine.isEmpty() && !containsWhitespace(tmpLine) && tmpLine.length() > 4) {
//first 4 chars to be escaped (ANSI color)
templates.add(tmpLine.substring(4));
if(!tmpLine.isEmpty() && !containsWhitespace(tmpLine)) {
templates.add(tmpLine);
}
}

Expand Down

0 comments on commit af540b8

Please sign in to comment.