2019-10-31 09:27:28 +08:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
# Makefile basic env setting
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
# add pipefail support for default shell
|
|
|
|
SHELL := /bin/bash -o pipefail
|
|
|
|
|
|
|
|
|
|
|
|
# Project basic setting
|
|
|
|
project_name ?= apache-apisix
|
|
|
|
project_version ?= latest
|
|
|
|
project_compose_ci ?= ci/pod/docker-compose.yml
|
|
|
|
project_release_name ?= $(project_name)-$(project_version)-src
|
|
|
|
|
|
|
|
|
|
|
|
# Hyperconverged Infrastructure
|
|
|
|
ENV_OS_NAME ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
|
|
|
|
ENV_OS_ARCH ?= $(shell uname -m | tr '[:upper:]' '[:lower:]')
|
|
|
|
ENV_APISIX ?= $(CURDIR)/bin/apisix
|
|
|
|
ENV_GIT ?= git
|
|
|
|
ENV_DOCKER ?= docker
|
|
|
|
ENV_DOCKER_COMPOSE ?= docker-compose --project-directory $(CURDIR) -p $(project_name) -f $(project_compose_ci)
|
|
|
|
ENV_NGINX ?= nginx -p $(CURDIR) -c $(CURDIR)/conf/nginx.conf
|
|
|
|
|
|
|
|
|
|
|
|
# OSX archive `._` cache file
|
|
|
|
ifeq ($(ENV_OS_NAME), darwin)
|
|
|
|
ENV_TAR ?= COPYFILE_DISABLE=1 tar
|
|
|
|
else
|
|
|
|
ENV_TAR ?= tar
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
# OLD VAR
|
2019-05-31 21:06:55 +08:00
|
|
|
INST_PREFIX ?= /usr
|
|
|
|
INST_LIBDIR ?= $(INST_PREFIX)/lib64/lua/5.1
|
|
|
|
INST_LUADIR ?= $(INST_PREFIX)/share/lua/5.1
|
2019-06-03 11:48:46 +08:00
|
|
|
INST_BINDIR ?= /usr/bin
|
2019-05-31 21:06:55 +08:00
|
|
|
INSTALL ?= install
|
2021-01-20 09:47:09 +08:00
|
|
|
OR_EXEC ?= $(shell which openresty || which nginx)
|
2021-03-08 17:13:39 +08:00
|
|
|
LUAROCKS ?= luarocks
|
2019-07-11 07:41:42 +08:00
|
|
|
LUAROCKS_VER ?= $(shell luarocks --version | grep -E -o "luarocks [0-9]+.")
|
2021-02-01 10:51:34 +08:00
|
|
|
OR_PREFIX ?= $(shell $(OR_EXEC) -V 2>&1 | grep -Eo 'prefix=(.*)/nginx\s+' | grep -Eo '/.*/')
|
2021-02-20 20:28:21 +08:00
|
|
|
OPENSSL_PREFIX ?= $(addprefix $(OR_PREFIX), openssl)
|
2021-06-30 21:16:47 +08:00
|
|
|
HOMEBREW_PREFIX ?= /usr/local
|
2021-02-20 20:28:21 +08:00
|
|
|
|
|
|
|
# OpenResty 1.17.8 or higher version uses openssl111 as the openssl dirname.
|
|
|
|
ifeq ($(shell test -d $(addprefix $(OR_PREFIX), openssl111) && echo -n yes), yes)
|
|
|
|
OPENSSL_PREFIX=$(addprefix $(OR_PREFIX), openssl111)
|
|
|
|
endif
|
2019-05-06 18:17:29 +08:00
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
ifeq ($(ENV_OS_NAME), darwin)
|
|
|
|
ifeq ($(ENV_OS_ARCH), arm64)
|
|
|
|
HOMEBREW_PREFIX=/opt/homebrew
|
|
|
|
endif
|
|
|
|
LUAROCKS=luarocks --lua-dir=$(HOMEBREW_PREFIX)/opt/lua@5.1
|
|
|
|
ifeq ($(shell test -d $(HOMEBREW_PREFIX)/opt/openresty-openssl && echo yes), yes)
|
|
|
|
OPENSSL_PREFIX=$(HOMEBREW_PREFIX)/opt/openresty-openssl
|
|
|
|
endif
|
|
|
|
ifeq ($(shell test -d $(HOMEBREW_PREFIX)/opt/openresty-openssl111 && echo yes), yes)
|
|
|
|
OPENSSL_PREFIX=$(HOMEBREW_PREFIX)/opt/openresty-openssl111
|
|
|
|
endif
|
2021-03-08 17:13:39 +08:00
|
|
|
endif
|
|
|
|
|
2021-03-23 20:10:57 +08:00
|
|
|
LUAROCKS_SERVER_OPT =
|
|
|
|
ifneq ($(LUAROCKS_SERVER), )
|
|
|
|
LUAROCKS_SERVER_OPT = --server ${LUAROCKS_SERVER}
|
|
|
|
endif
|
|
|
|
|
2020-10-22 13:11:45 +08:00
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
# Makefile basic extension function
|
|
|
|
_color_red =\E[1;31m
|
|
|
|
_color_green =\E[1;32m
|
|
|
|
_color_yellow =\E[1;33m
|
|
|
|
_color_blue =\E[1;34m
|
|
|
|
_color_wipe =\E[0m
|
|
|
|
|
|
|
|
|
|
|
|
define func_echo_status
|
|
|
|
printf "[%b info %b] %s\n" "$(_color_blue)" "$(_color_wipe)" $(1)
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
define func_echo_warn_status
|
|
|
|
printf "[%b info %b] %s\n" "$(_color_yellow)" "$(_color_wipe)" $(1)
|
|
|
|
endef
|
2019-06-11 12:21:49 +08:00
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
|
|
|
|
define func_echo_success_status
|
|
|
|
printf "[%b info %b] %s\n" "$(_color_green)" "$(_color_wipe)" $(1)
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
define func_check_folder
|
|
|
|
if [[ ! -d $(1) ]]; then \
|
|
|
|
mkdir -p $(1); \
|
|
|
|
$(call func_echo_status, 'folder check -> create `$(1)`'); \
|
|
|
|
else \
|
|
|
|
$(call func_echo_success_status, 'folder check -> found `$(1)`'); \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
# Makefile target
|
|
|
|
.PHONY: runtime
|
|
|
|
runtime:
|
2019-11-25 13:09:32 +08:00
|
|
|
ifeq ($(OR_EXEC), )
|
2019-11-26 21:24:45 +08:00
|
|
|
ifeq ("$(wildcard /usr/local/openresty-debug/bin/openresty)", "")
|
2021-01-29 23:57:46 +08:00
|
|
|
@echo "WARNING: OpenResty not found. You have to install OpenResty and add the binary file to PATH before install Apache APISIX."
|
2019-11-25 13:09:32 +08:00
|
|
|
exit 1
|
2021-01-29 23:57:46 +08:00
|
|
|
else
|
|
|
|
OR_EXEC=/usr/local/openresty-debug/bin/openresty
|
2019-11-25 13:09:32 +08:00
|
|
|
endif
|
2019-11-26 21:24:45 +08:00
|
|
|
endif
|
2019-06-11 12:21:49 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### help : Show Makefile rules
|
2021-10-15 19:19:55 +08:00
|
|
|
### If there're awk failures, please make sure
|
|
|
|
### you are using awk or gawk
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: help
|
2021-10-13 09:02:09 +08:00
|
|
|
help:
|
|
|
|
@$(call func_echo_success_status, "Makefile rules:")
|
|
|
|
@echo
|
|
|
|
@if [ '$(ENV_OS_NAME)' = 'darwin' ]; then \
|
|
|
|
awk '{ if(match($$0, /^#{3}([^:]+):(.*)$$/)){ split($$0, res, ":"); gsub(/^#{3}[ ]*/, "", res[1]); _desc=$$0; gsub(/^#{3}([^:]+):[ \t]*/, "", _desc); printf(" make %-15s : %-10s\n", res[1], _desc) } }' Makefile; \
|
|
|
|
else \
|
|
|
|
awk '{ if(match($$0, /^\s*#{3}\s*([^:]+)\s*:\s*(.*)$$/, res)){ printf(" make %-15s : %-10s\n", res[1], res[2]) } }' Makefile; \
|
|
|
|
fi
|
2019-05-06 18:17:29 +08:00
|
|
|
@echo
|
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### deps : Installation dependencies
|
2019-11-12 16:38:23 +08:00
|
|
|
.PHONY: deps
|
2021-10-13 09:02:09 +08:00
|
|
|
deps: runtime
|
2020-03-10 15:16:14 +08:00
|
|
|
ifeq ($(LUAROCKS_VER),luarocks 3.)
|
2021-02-03 22:38:27 +08:00
|
|
|
mkdir -p ~/.luarocks
|
|
|
|
ifeq ($(shell whoami),root)
|
2021-03-08 17:13:39 +08:00
|
|
|
$(LUAROCKS) config variables.OPENSSL_LIBDIR $(addprefix $(OPENSSL_PREFIX), /lib)
|
|
|
|
$(LUAROCKS) config variables.OPENSSL_INCDIR $(addprefix $(OPENSSL_PREFIX), /include)
|
2021-02-03 22:38:27 +08:00
|
|
|
else
|
2021-03-08 17:13:39 +08:00
|
|
|
$(LUAROCKS) config --local variables.OPENSSL_LIBDIR $(addprefix $(OPENSSL_PREFIX), /lib)
|
|
|
|
$(LUAROCKS) config --local variables.OPENSSL_INCDIR $(addprefix $(OPENSSL_PREFIX), /include)
|
2021-02-03 22:38:27 +08:00
|
|
|
endif
|
2021-03-23 20:10:57 +08:00
|
|
|
$(LUAROCKS) install rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local $(LUAROCKS_SERVER_OPT)
|
2019-07-05 19:01:20 +08:00
|
|
|
else
|
2021-02-01 10:51:34 +08:00
|
|
|
@echo "WARN: You're not using LuaRocks 3.x, please add the following items to your LuaRocks config file:"
|
|
|
|
@echo "variables = {"
|
2021-02-20 20:28:21 +08:00
|
|
|
@echo " OPENSSL_LIBDIR=$(addprefix $(OPENSSL_PREFIX), /lib)"
|
|
|
|
@echo " OPENSSL_INCDIR=$(addprefix $(OPENSSL_PREFIX), /include)"
|
2021-02-01 10:51:34 +08:00
|
|
|
@echo "}"
|
2021-10-13 09:02:09 +08:00
|
|
|
$(LUAROCKS) install rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local $(LUAROCKS_SERVER_OPT)
|
2019-07-05 19:01:20 +08:00
|
|
|
endif
|
2019-11-12 16:38:23 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### utils : Installation tools
|
2019-11-12 16:38:23 +08:00
|
|
|
.PHONY: utils
|
|
|
|
utils:
|
2019-11-21 09:23:16 +08:00
|
|
|
ifeq ("$(wildcard utils/lj-releng)", "")
|
2020-10-10 20:49:14 +08:00
|
|
|
wget -P utils https://raw.githubusercontent.com/iresty/openresty-devel-utils/master/lj-releng
|
2019-09-23 05:54:37 +08:00
|
|
|
chmod a+x utils/lj-releng
|
2019-09-23 11:14:49 +08:00
|
|
|
endif
|
2021-01-18 10:27:28 +08:00
|
|
|
ifeq ("$(wildcard utils/reindex)", "")
|
|
|
|
wget -P utils https://raw.githubusercontent.com/iresty/openresty-devel-utils/master/reindex
|
|
|
|
chmod a+x utils/reindex
|
|
|
|
endif
|
2019-06-15 11:22:48 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### lint : Lint source code
|
2019-11-21 09:23:16 +08:00
|
|
|
.PHONY: lint
|
|
|
|
lint: utils
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
2020-02-18 15:54:30 +08:00
|
|
|
./utils/check-lua-code-style.sh
|
2021-01-18 10:27:28 +08:00
|
|
|
./utils/check-test-code-style.sh
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-06-16 07:32:25 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### init : Initialize the runtime environment
|
2019-07-05 19:01:20 +08:00
|
|
|
.PHONY: init
|
2021-10-13 09:02:09 +08:00
|
|
|
init: runtime
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_APISIX) init
|
|
|
|
$(ENV_APISIX) init_etcd
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-07-05 19:01:20 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### run : Start the apisix server
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: run
|
2021-10-13 09:02:09 +08:00
|
|
|
run: runtime
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_APISIX) start
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-05-06 18:17:29 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### quit : Stop the apisix server, exit gracefully
|
2021-06-18 15:09:34 +08:00
|
|
|
.PHONY: quit
|
2021-10-13 09:02:09 +08:00
|
|
|
quit: runtime
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_APISIX) quit
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2021-06-18 15:09:34 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### stop : Stop the apisix server, exit immediately
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: stop
|
2021-10-13 09:02:09 +08:00
|
|
|
stop: runtime
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_APISIX) stop
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-05-06 18:17:29 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### verify : Verify the configuration of apisix server
|
2020-02-09 20:43:30 +08:00
|
|
|
.PHONY: verify
|
2021-10-13 09:02:09 +08:00
|
|
|
verify: runtime
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_NGINX) -t
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2020-02-09 20:43:30 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### clean : Remove generated files
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
2019-05-06 18:17:29 +08:00
|
|
|
rm -rf logs/
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-05-06 18:17:29 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### reload : Reload the apisix server
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: reload
|
2021-10-13 09:02:09 +08:00
|
|
|
reload: runtime
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_NGINX) -s reload
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-05-31 21:06:55 +08:00
|
|
|
|
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### install : Install the apisix (only for luarocks)
|
2019-05-31 21:06:55 +08:00
|
|
|
.PHONY: install
|
2021-10-13 09:02:09 +08:00
|
|
|
install: runtime
|
2020-04-20 09:09:14 +08:00
|
|
|
$(INSTALL) -d /usr/local/apisix/
|
2019-06-05 15:06:28 +08:00
|
|
|
$(INSTALL) -d /usr/local/apisix/logs/
|
2019-06-22 10:44:07 +08:00
|
|
|
$(INSTALL) -d /usr/local/apisix/conf/cert
|
2019-06-05 15:06:28 +08:00
|
|
|
$(INSTALL) conf/mime.types /usr/local/apisix/conf/mime.types
|
2019-06-04 21:16:23 +08:00
|
|
|
$(INSTALL) conf/config.yaml /usr/local/apisix/conf/config.yaml
|
2020-08-18 20:18:55 +08:00
|
|
|
$(INSTALL) conf/config-default.yaml /usr/local/apisix/conf/config-default.yaml
|
2021-02-26 10:05:41 +08:00
|
|
|
$(INSTALL) conf/debug.yaml /usr/local/apisix/conf/debug.yaml
|
2020-12-16 18:09:52 +08:00
|
|
|
$(INSTALL) conf/cert/* /usr/local/apisix/conf/cert/
|
2019-06-04 20:53:58 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix
|
|
|
|
$(INSTALL) apisix/*.lua $(INST_LUADIR)/apisix/
|
2019-10-08 16:46:53 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/admin
|
|
|
|
$(INSTALL) apisix/admin/*.lua $(INST_LUADIR)/apisix/admin/
|
2019-06-05 15:06:28 +08:00
|
|
|
|
2020-06-19 12:46:20 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/balancer
|
|
|
|
$(INSTALL) apisix/balancer/*.lua $(INST_LUADIR)/apisix/balancer/
|
|
|
|
|
2020-12-18 16:40:17 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/control
|
|
|
|
$(INSTALL) apisix/control/*.lua $(INST_LUADIR)/apisix/control/
|
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/core
|
|
|
|
$(INSTALL) apisix/core/*.lua $(INST_LUADIR)/apisix/core/
|
2019-10-08 16:46:53 +08:00
|
|
|
|
2021-02-25 09:42:31 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/core/dns
|
|
|
|
$(INSTALL) apisix/core/dns/*.lua $(INST_LUADIR)/apisix/core/dns
|
|
|
|
|
2020-10-31 22:56:42 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/cli
|
|
|
|
$(INSTALL) apisix/cli/*.lua $(INST_LUADIR)/apisix/cli/
|
|
|
|
|
2020-10-11 12:27:03 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/discovery
|
|
|
|
$(INSTALL) apisix/discovery/*.lua $(INST_LUADIR)/apisix/discovery/
|
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/http
|
|
|
|
$(INSTALL) apisix/http/*.lua $(INST_LUADIR)/apisix/http/
|
2019-10-08 16:46:53 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/http/router
|
|
|
|
$(INSTALL) apisix/http/router/*.lua $(INST_LUADIR)/apisix/http/router/
|
2019-07-12 20:26:36 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins
|
|
|
|
$(INSTALL) apisix/plugins/*.lua $(INST_LUADIR)/apisix/plugins/
|
2019-09-06 15:51:50 +08:00
|
|
|
|
2021-04-23 09:16:51 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/ext-plugin
|
2021-04-29 11:07:05 +08:00
|
|
|
$(INSTALL) apisix/plugins/ext-plugin/*.lua $(INST_LUADIR)/apisix/plugins/ext-plugin/
|
2021-04-23 09:16:51 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/grpc-transcode
|
|
|
|
$(INSTALL) apisix/plugins/grpc-transcode/*.lua $(INST_LUADIR)/apisix/plugins/grpc-transcode/
|
2019-08-06 18:06:42 +08:00
|
|
|
|
2021-07-21 07:09:44 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/ip-restriction
|
|
|
|
$(INSTALL) apisix/plugins/ip-restriction/*.lua $(INST_LUADIR)/apisix/plugins/ip-restriction/
|
|
|
|
|
2021-07-13 13:17:52 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/limit-conn
|
|
|
|
$(INSTALL) apisix/plugins/limit-conn/*.lua $(INST_LUADIR)/apisix/plugins/limit-conn/
|
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/limit-count
|
|
|
|
$(INSTALL) apisix/plugins/limit-count/*.lua $(INST_LUADIR)/apisix/plugins/limit-count/
|
2019-08-22 14:40:56 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/prometheus
|
|
|
|
$(INSTALL) apisix/plugins/prometheus/*.lua $(INST_LUADIR)/apisix/plugins/prometheus/
|
2019-10-08 13:15:48 +08:00
|
|
|
|
2021-10-21 15:57:54 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/proxy-cache
|
|
|
|
$(INSTALL) apisix/plugins/proxy-cache/*.lua $(INST_LUADIR)/apisix/plugins/proxy-cache/
|
|
|
|
|
2020-11-04 09:49:14 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/serverless
|
|
|
|
$(INSTALL) apisix/plugins/serverless/*.lua $(INST_LUADIR)/apisix/plugins/serverless/
|
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/zipkin
|
|
|
|
$(INSTALL) apisix/plugins/zipkin/*.lua $(INST_LUADIR)/apisix/plugins/zipkin/
|
2019-06-04 20:53:58 +08:00
|
|
|
|
2020-10-11 12:27:03 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/ssl/router
|
|
|
|
$(INSTALL) apisix/ssl/router/*.lua $(INST_LUADIR)/apisix/ssl/router/
|
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/stream/plugins
|
|
|
|
$(INSTALL) apisix/stream/plugins/*.lua $(INST_LUADIR)/apisix/stream/plugins/
|
2019-10-08 16:46:53 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/stream/router
|
|
|
|
$(INSTALL) apisix/stream/router/*.lua $(INST_LUADIR)/apisix/stream/router/
|
2019-10-08 16:46:53 +08:00
|
|
|
|
2020-03-31 23:23:29 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/utils
|
|
|
|
$(INSTALL) apisix/utils/*.lua $(INST_LUADIR)/apisix/utils/
|
2020-03-27 07:34:08 +08:00
|
|
|
|
2019-06-04 10:32:14 +08:00
|
|
|
$(INSTALL) bin/apisix $(INST_BINDIR)/apisix
|
2021-02-16 12:14:46 +08:00
|
|
|
|
2020-11-19 00:04:01 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/plugins/slslog
|
|
|
|
$(INSTALL) apisix/plugins/slslog/*.lua $(INST_LUADIR)/apisix/plugins/slslog/
|
2019-06-03 16:24:38 +08:00
|
|
|
|
2019-07-15 08:46:10 +08:00
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
### test : Run the test case
|
2021-05-18 14:27:42 +08:00
|
|
|
.PHONY: test
|
2019-06-03 16:24:38 +08:00
|
|
|
test:
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_GIT) submodule update --init --recursive
|
2019-07-10 11:32:16 +08:00
|
|
|
prove -I../test-nginx/lib -I./ -r -s t/
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
2019-11-21 09:23:16 +08:00
|
|
|
|
2021-10-13 09:02:09 +08:00
|
|
|
|
|
|
|
### license-check : Check project source code for Apache License
|
2019-11-21 09:23:16 +08:00
|
|
|
.PHONY: license-check
|
|
|
|
license-check:
|
2021-10-13 09:02:09 +08:00
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_DOCKER) run -it --rm -v $(CURDIR):/github/workspace apache/skywalking-eyes header check
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
|
|
|
|
2019-11-21 09:23:16 +08:00
|
|
|
|
2021-05-18 14:27:42 +08:00
|
|
|
.PHONY: release-src
|
2021-02-19 09:09:33 +08:00
|
|
|
release-src: compress-tar
|
2021-10-13 09:02:09 +08:00
|
|
|
gpg --batch --yes --armor --detach-sig $(project_release_name).tgz
|
|
|
|
shasum -a 512 $(project_release_name).tgz > $(project_release_name).tgz.sha512
|
2021-02-19 09:09:33 +08:00
|
|
|
|
|
|
|
mkdir -p release
|
2021-10-13 09:02:09 +08:00
|
|
|
mv $(project_release_name).tgz release/$(project_release_name).tgz
|
|
|
|
mv $(project_release_name).tgz.asc release/$(project_release_name).tgz.asc
|
|
|
|
mv $(project_release_name).tgz.sha512 release/$(project_release_name).tgz.sha512
|
|
|
|
|
2021-02-19 09:09:33 +08:00
|
|
|
|
2021-05-18 14:27:42 +08:00
|
|
|
.PHONY: compress-tar
|
2021-02-19 09:09:33 +08:00
|
|
|
compress-tar:
|
2021-10-13 09:02:09 +08:00
|
|
|
$(ENV_TAR) -zcvf $(project_release_name).tgz \
|
2021-02-09 20:07:59 +08:00
|
|
|
./apisix \
|
|
|
|
./bin \
|
|
|
|
./conf \
|
2021-10-13 09:02:09 +08:00
|
|
|
./rockspec/apisix-$(project_version)-*.rockspec \
|
2021-03-02 23:33:40 +08:00
|
|
|
./rockspec/apisix-master-0.rockspec \
|
2021-02-09 20:07:59 +08:00
|
|
|
LICENSE \
|
|
|
|
Makefile \
|
|
|
|
NOTICE \
|
|
|
|
*.md
|
2021-10-13 09:02:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
### container
|
|
|
|
### ci-env-up : launch ci env
|
|
|
|
.PHONY: ci-env-up
|
|
|
|
ci-env-up:
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_DOCKER_COMPOSE) up -d
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
|
|
|
|
|
|
|
|
|
|
|
### ci-env-ps : ci env ps
|
|
|
|
.PHONY: ci-env-ps
|
|
|
|
ci-env-ps:
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_DOCKER_COMPOSE) ps
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
|
|
|
|
|
|
|
|
|
|
|
### ci-env-rebuild : ci env image rebuild
|
|
|
|
.PHONY: ci-env-rebuild
|
|
|
|
ci-env-rebuild:
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_DOCKER_COMPOSE) build
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|
|
|
|
|
|
|
|
|
|
|
|
### ci-env-down : destroy ci env
|
|
|
|
.PHONY: ci-env-down
|
|
|
|
ci-env-down:
|
|
|
|
@$(call func_echo_status, "$@ -> [ Start ]")
|
|
|
|
$(ENV_DOCKER_COMPOSE) down
|
|
|
|
@$(call func_echo_success_status, "$@ -> [ Done ]")
|