diff --git a/Makefile b/Makefile index 8f1d6a37..318b3f41 100644 --- a/Makefile +++ b/Makefile @@ -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" @@ -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) \ diff --git a/build-openresty.sh b/build-openresty.sh index a1956706..8ccbcbdd 100755 --- a/build-openresty.sh +++ b/build-openresty.sh @@ -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 \ diff --git a/dockerfiles/Dockerfile.openresty b/dockerfiles/Dockerfile.openresty index c627dbea..0d96b894 100644 --- a/dockerfiles/Dockerfile.openresty +++ b/dockerfiles/Dockerfile.openresty @@ -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 diff --git a/openresty-build-tools/kong-ngx-build b/openresty-build-tools/kong-ngx-build index 868e5d5a..80489f8a 100755 --- a/openresty-build-tools/kong-ngx-build +++ b/openresty-build-tools/kong-ngx-build @@ -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