ddragosd commented on a change in pull request #77: Fixes a few linux issues
with the makefile
URL:
https://github.com/apache/incubator-openwhisk-devtools/pull/77#discussion_r160179421
##########
File path: docker-compose/Makefile
##########
@@ -1,8 +1,14 @@
+UNAME_STR ?= $(shell uname)
+
# detect local ip of host as this is needed within containers to find the
openwhisk API container
-LOCAL_IP ?= $(shell ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2
| head -1)
-# if no IP was found, fallback to "localhost"
-ifeq ($(LOCAL_IP), )
- LOCAL_IP = "localhost"
+ifeq ("$(UNAME_STR)","Linux")
+ LOCAL_IP=$(shell route | grep default | tr -s " " | cut -d " " -f 8 |
xargs ifconfig | grep "inet addr:" | cut -d ":" -f 2 | cut -d " " -f 1)
+else
+ LOCAL_IP ?= $(shell ifconfig | grep "inet " | grep -v 127.0.0.1 | cut
-d\ -f2 | head -1)
Review comment:
?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services