Skip to content

Commit

Permalink
Fixing envsubstitution
Browse files Browse the repository at this point in the history
  • Loading branch information
ambud committed May 3, 2017
1 parent 12595f5 commit 08784d9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Expand Up @@ -7,11 +7,16 @@ RUN yum -y install wget
RUN rpm --import http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.3.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
RUN cd /etc/yum.repos.d/;wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.3.0/hdp.repo
RUN yum -y install kafka
RUN yum -y install gettext

RUN mkdir -p /etc/mirror-maker/
ADD ./consumer.config /etc/mirror-maker/
ADD ./producer.config /etc/mirror-maker/
ADD ./consumer.config /tmp/mirror-maker/
ADD ./producer.config /tmp/mirror-maker/
ADD ./run.sh /etc/mirror-maker/
RUN chmod +x /etc/mirror-maker/run.sh

ENV DESTINATION "localhost:6667"
ENV SOURCE "localhost:6667"
ENV SECURITY "PLAINTEXT"

CMD /etc/mirror-maker/run.sh
3 changes: 2 additions & 1 deletion consumer.config
@@ -1 +1,2 @@
security.protocol=${SECURITY.PROTOCOL}
security.protocol=${SECURITY}
bootstrap.servers=${SOURCE}
3 changes: 2 additions & 1 deletion producer.config
@@ -1 +1,2 @@
security.protocol=${SECURITY.PROTOCOL}
security.protocol=${SECURITY}
bootstrap.servers=${DESTINATION}
7 changes: 7 additions & 0 deletions run.sh
@@ -1,6 +1,13 @@
#!/bin/bash
################################################################
#
# Author: Ambud Sharma
#
################################################################

set -eu

envsubst < /tmp/mirror-maker/producer.config > /etc/mirror-maker/producer.config
envsubst < /tmp/mirror-maker/consumer.config > /etc/mirror-maker/consumer.config

/usr/hdp/current/kafka-broker/bin/kafka-mirror-maker.sh --whitelist ${WHITELIST} --abort.on.send.failure false --new.consumer --producer.config /etc/mirror-maker/producer.config --consumer.config /etc/mirror-maker/consumer.config

0 comments on commit 08784d9

Please sign in to comment.