Skip to content

Commit

Permalink
Merge pull request #38 from CDOT-CV/Update/do_kafka_test_docker_ip
Browse files Browse the repository at this point in the history
Update do_kafka_test to set DOCKER_HOST_IP
  • Loading branch information
payneBrandon authored Jan 17, 2024
2 parents 68f11dd + 7611da4 commit 68fa949
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions do_kafka_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ PPM_IMAGE_TAG=do-kafka-test-ppm-image
PPM_IMAGE_NAME=jpo-cvdp_ppm

setup() {
if [ -z $DOCKER_HOST_IP ]; then
echo "DOCKER_HOST_IP is not set. Exiting."
if [ -z $DOCKER_HOST_IP ]
then
export DOCKER_HOST_IP=$(ifconfig | grep -A 1 'inet ' | grep -v 'inet6\|127.0.0.1' | awk '{print $2}' | grep -E '^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168\.' | head -n 1)
fi
if [ -z $DOCKER_HOST_IP ]
then
echo "DOCKER_HOST_IP is not set and could not be determined. Exiting."
exit 1
fi


# print setup info
echo "=== Setup Info ==="
echo "DOCKER_HOST_IP: $DOCKER_HOST_IP"
Expand Down

0 comments on commit 68fa949

Please sign in to comment.