Skip to content

Commit

Permalink
feat(enterprise): install the kong-licensing nginx module only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aboudreault committed Jul 15, 2022
1 parent 02408a7 commit 9812389
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ TEST_COMPOSE_PATH="$(PWD)/test/kong-tests-compose.yaml"

KONG_SOURCE_LOCATION?="$$PWD/../kong/"
EDITION?=`grep EDITION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'`
ENABLE_KONG_LICENSING?=`grep ENABLE_KONG_LICENSING $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'`

KONG_LICENSE?="ASL 2.0"

Expand Down Expand Up @@ -193,6 +194,7 @@ else
--build-arg DOCKER_BASE_SUFFIX=$(DOCKER_BASE_SUFFIX) \
--build-arg LIBYAML_VERSION=$(LIBYAML_VERSION) \
--build-arg EDITION=$(EDITION) \
--build-arg ENABLE_KONG_LICENSING=$(ENABLE_KONG_LICENSING) \
--build-arg KONG_NGINX_MODULE=$(KONG_NGINX_MODULE) \
--build-arg RESTY_LMDB=$(RESTY_LMDB) \
--build-arg RESTY_WEBSOCKET=$(RESTY_WEBSOCKET) \
Expand Down
1 change: 1 addition & 0 deletions build-openresty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ OPENSSL_DESTDIR=/tmp/build \
OPENRESTY_RPATH=/usr/local/kong/lib \
OPENRESTY_PATCHES=$OPENRESTY_PATCHES \
EDITION=$EDITION \
ENABLE_KONG_LICENSING=$ENABLE_KONG_LICENSING \
/tmp/openresty-build-tools/kong-ngx-build -p /tmp/build/usr/local \
--openresty $RESTY_VERSION \
--openssl $RESTY_OPENSSL_VERSION \
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/Dockerfile.openresty
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM kong/kong-build-tools:$PACKAGE_TYPE-1.5.15

ARG EDITION="community"
ENV EDITION $EDITION
ARG ENABLE_KONG_LICENSING="true"
ENV ENABLE_KONG_LICENSING $ENABLE_KONG_LICENSING

ARG LIBYAML_VERSION=0.2.5
ENV LIBYAML_VERSION $LIBYAML_VERSION
Expand Down
4 changes: 3 additions & 1 deletion openresty-build-tools/kong-ngx-build
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,9 @@ main() {
)

if [ "$EDITION" == 'enterprise' ]; then
OPENRESTY_OPTS+=('--add-module=/distribution/kong-licensing/ngx_module')
if [ "$ENABLE_KONG_LICENSING" != "false" ]; then
OPENRESTY_OPTS+=('--add-module=/distribution/kong-licensing/ngx_module')
fi
OPENRESTY_OPTS+=('--add-module=/distribution/lua-resty-openssl-aux-module')
fi

Expand Down

0 comments on commit 9812389

Please sign in to comment.