Skip to content

Commit 9a4dad8

Browse files
CreativeCactusstyle95
authored andcommitted
Improving support for other platforms (nixos) (#311)
* Allow for other paths to ifconfig ifconfig might not always be in the same place (eg. on nixos). This way, `env ifconfig x` will point to `ifconfig x`. * Forcing env bash to run genssl This might cause issues on other platforms, since this change does not seem to be scoped to a `uname` check, as previous changes were. Please test.
1 parent 0f2786f commit 9a4dad8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docker-compose/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ UNAME_STR ?= $(shell uname)
22

33
# detect local ip of host as this is needed within containers to find the OpenWhisk API container
44
ifeq ("$(UNAME_STR)","Linux")
5-
LOCAL_IP=$(shell LANG=en_US.utf8; route | grep default | tr -s " " | cut -d " " -f 8 | xargs /sbin/ifconfig | grep "inet addr:" | cut -d ":" -f 2 | cut -d " " -f 1)
5+
LOCAL_IP=$(shell LANG=en_US.utf8; route | grep default | tr -s " " | cut -d " " -f 8 | xargs env ifconfig | grep "inet addr:" | cut -d ":" -f 2 | cut -d " " -f 1)
66
# inet addr: not present, trying with inet.
77
ifeq ($(LOCAL_IP), )
8-
LOCAL_IP=$(shell route | grep default | tr -s " " | cut -d " " -f 8 | xargs /sbin/ifconfig | grep "inet " | tr -s " " | cut -d " " -f 3)
8+
LOCAL_IP=$(shell route | grep default | tr -s " " | cut -d " " -f 8 | xargs env ifconfig | grep "inet " | tr -s " " | cut -d " " -f 3)
99
endif
1010
else
1111
LOCAL_IP ?= $(shell ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2 | head -1)
@@ -241,7 +241,7 @@ setup:
241241
[ -f "$(OPENWHISK_PROJECT_HOME)/ansible/roles/nginx/files/openwhisk-server-cert.pem" ]; then \
242242
echo "using certificates present in $(OPENWHISK_PROJECT_HOME)/ansible/roles/nginx/files/"; \
243243
else \
244-
$(OPENWHISK_PROJECT_HOME)/ansible/files/genssl.sh $(DOCKER_HOST_IP) server $(OPENWHISK_PROJECT_HOME)/ansible/roles/nginx/files; \
244+
env bash $(OPENWHISK_PROJECT_HOME)/ansible/files/genssl.sh $(DOCKER_HOST_IP) server $(OPENWHISK_PROJECT_HOME)/ansible/roles/nginx/files; \
245245
fi;
246246
mkdir -p $(TMP_HOME)/tmp/openwhisk/api-gateway-ssl
247247
cp $(OPENWHISK_PROJECT_HOME)/ansible/roles/nginx/files/*.pem $(TMP_HOME)/tmp/openwhisk/api-gateway-ssl

0 commit comments

Comments
 (0)