Skip to content

Commit

Permalink
updated entrypoint.sh to enable capi port overriding (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharanikesav authored and ceejatec committed Jun 20, 2018
1 parent d6d3d0c commit 1856b44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion generate/resources/couchbase-server/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
set -e

staticConfigFile=/opt/couchbase/etc/couchbase/static_config
capiConfigFile=/opt/couchbase/etc/couchdb/default.d/capi.ini
restPortValue=8091
capiPortValue=8092

# see https://developer.couchbase.com/documentation/server/current/install/install-ports.html
function overridePort() {
Expand All @@ -24,6 +26,15 @@ function overridePort() {
fi
fi
fi

if [ "$portNameUpper" == "CAPI_PORT" ]; then
if grep -Fq "{${portValue}," ${capiConfigFile}
then
echo "Don't override port ${portName} because already available in $staticConfigFile"
else
sed -i -e "s/${capiPortValue}/${portValue}/g" ${capiConfigFile}
fi
fi
}

overridePort "rest_port"
Expand All @@ -37,7 +48,7 @@ overridePort "ssl_rest_port"
overridePort "ssl_capi_port"
overridePort "ssl_proxy_downstream_port"
overridePort "ssl_proxy_upstream_port"

overridePort "capi_port"

[[ "$1" == "couchbase-server" ]] && {

Expand Down

0 comments on commit 1856b44

Please sign in to comment.