openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rab...@apache.org
Subject [incubator-openwhisk-devtools] branch master updated: Fix calling openwhisk from action (#61)
Date Tue, 28 Nov 2017 08:37:56 GMT
This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-devtools.git


The following commit(s) were added to refs/heads/master by this push:
     new d08ffe1  Fix calling openwhisk from action (#61)
d08ffe1 is described below

commit d08ffe1ec8f865697f732e441d7a3f6dcbbd2737
Author: Alexander Klimetschek <alexander@klimetschek.de>
AuthorDate: Tue Nov 28 00:37:54 2017 -0800

    Fix calling openwhisk from action (#61)
    
    Try to determines API host for controller instead of always using localhost.
---
 docker-compose/Makefile | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/docker-compose/Makefile b/docker-compose/Makefile
index 1f9ca78..65dce5a 100644
--- a/docker-compose/Makefile
+++ b/docker-compose/Makefile
@@ -1,4 +1,11 @@
-DOCKER_HOST_IP ?= $(shell echo ${DOCKER_HOST} | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
|| echo localhost)
+# 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"
+endif
+
+DOCKER_HOST_IP ?= $(shell echo ${DOCKER_HOST} | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
|| echo ${LOCAL_IP})
 DOCKER_REGISTRY ?= ""
 DOCKER_IMAGE_PREFIX ?= openwhisk
 PROJECT_HOME ?= ./openwhisk-master
@@ -54,7 +61,10 @@ build-cli:
 		./gradlew :tools:cli:distDocker
 
 .PHONY: run
-run: check-required-ports setup start-docker-compose init-couchdb init-whisk-cli
+run: print-host check-required-ports setup start-docker-compose init-couchdb init-whisk-cli
+
+print-host:
+	echo "host ip address: ${DOCKER_HOST_IP}"
 
 .PHONY: check-required-ports
 check-required-ports:

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message