openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rab...@apache.org
Subject [incubator-openwhisk] branch master updated: optional bypass of whisk.properties when setting GW_ values (#3112)
Date Tue, 19 Dec 2017 03:42:00 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.git


The following commit(s) were added to refs/heads/master by this push:
     new ab20fbf  optional bypass of whisk.properties when setting GW_ values (#3112)
ab20fbf is described below

commit ab20fbf7d7f1debe3b52cae9745e2d1bf04d1ff7
Author: David Grove <dgrove-oss@users.noreply.github.com>
AuthorDate: Mon Dec 18 22:41:56 2017 -0500

    optional bypass of whisk.properties when setting GW_ values (#3112)
    
    If GW_USER, GW_PWD, or GW_HOST_V2 are already set in the environment
    when running installRouteMgmt.sh then use the value from the
    environment bypassing the values in whisk.properties.
    This is useful for downstream deployments such as kube to avoid
    the need to generate a whisk.properties just to run this script.
---
 ansible/roles/routemgmt/files/installRouteMgmt.sh | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/ansible/roles/routemgmt/files/installRouteMgmt.sh b/ansible/roles/routemgmt/files/installRouteMgmt.sh
index bf805ce..73a497e 100755
--- a/ansible/roles/routemgmt/files/installRouteMgmt.sh
+++ b/ansible/roles/routemgmt/files/installRouteMgmt.sh
@@ -22,9 +22,15 @@ NAMESPACE="$3"
 WSK_CLI="$4"
 
 WHISKPROPS_FILE="$OPENWHISK_HOME/whisk.properties"
-GW_USER=`fgrep apigw.auth.user= $WHISKPROPS_FILE | cut -d'=' -f2`
-GW_PWD=`fgrep apigw.auth.pwd= $WHISKPROPS_FILE | cut -d'=' -f2-`
-GW_HOST_V2=`fgrep apigw.host.v2= $WHISKPROPS_FILE | cut -d'=' -f2`
+if [ -z "$GW_USER" ]; then
+   GW_USER=`fgrep apigw.auth.user= $WHISKPROPS_FILE | cut -d'=' -f2`
+fi
+if [ -z "$GW_PWD" ]; then
+    GW_PWD=`fgrep apigw.auth.pwd= $WHISKPROPS_FILE | cut -d'=' -f2-`
+fi
+if [ -z "$GW_HOST_V2" ]; then
+    GW_HOST_V2=`fgrep apigw.host.v2= $WHISKPROPS_FILE | cut -d'=' -f2`
+fi
 
 # If the auth key file exists, read the key in the file. Otherwise, take the
 # first argument as the key itself.

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

Mime
View raw message