Skip to content

Commit

Permalink
find host ip using ifconfig on mac (hyperledger-archives#2914)
Browse files Browse the repository at this point in the history
Signed-off-by: andrew-coleman <[email protected]>
  • Loading branch information
andrew-coleman authored and nklincoln committed Dec 1, 2017
1 parent a7034fb commit 02e8cb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/composer-tests-functional/scripts/run-fv-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ for FVTEST in $(echo ${FVTEST} | tr "," " "); do
cd ../composer-common
npm publish --registry http://localhost:4873
cd ../composer-runtime-hlfv1
GATEWAY="$(docker inspect hlfv1_default | grep Gateway | cut -d \" -f4)"
if [ `uname` = "Darwin" ]; then
GATEWAY="$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')"
else
GATEWAY="$(docker inspect hlfv1_default | grep Gateway | cut -d \" -f4)"
fi
echo registry=http://${GATEWAY}:4873 > .npmrc
cd "${DIR}"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ for INTEST in $(echo ${INTEST} | tr "," " "); do
ARCH=$ARCH docker-compose -f ${DOCKER_FILE} up -d
cd ${DIR}
cd ../composer-runtime-hlfv1
GATEWAY="$(docker inspect hlfv1_default | grep Gateway | cut -d \" -f4)"
if [ `uname` = "Darwin" ]; then
GATEWAY="$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')"
else
GATEWAY="$(docker inspect hlfv1_default | grep Gateway | cut -d \" -f4)"
fi
echo registry=http://${GATEWAY}:4873 > .npmrc
fi

Expand Down

0 comments on commit 02e8cb6

Please sign in to comment.