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
2021-11-23 21:08:33 +08:00
VERSION ?= master
2021-10-13 09:02:09 +08:00
project_name ?= apache-apisix
project_compose_ci ?= ci/pod/docker-compose.yml
2021-11-23 21:08:33 +08:00
project_release_name ?= $( project_name) -$( VERSION) -src
2021-10-13 09:02:09 +08:00
# 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
2021-10-22 14:15:33 +08:00
ENV_TAR ?= tar
ENV_INSTALL ?= install
2021-10-13 09:02:09 +08:00
ENV_DOCKER ?= docker
ENV_DOCKER_COMPOSE ?= docker-compose --project-directory $( CURDIR) -p $( project_name) -f $( project_compose_ci)
2021-10-22 14:15:33 +08:00
ENV_NGINX ?= $( ENV_NGINX_EXEC) -p $( CURDIR) -c $( CURDIR) /conf/nginx.conf
ENV_NGINX_EXEC := $( shell which openresty 2>/dev/null || which nginx 2>/dev/null)
ENV_OPENSSL_PREFIX ?= $( addprefix $( ENV_NGINX_PREFIX) , openssl)
ENV_LUAROCKS ?= luarocks
## These variables can be injected by luarocks
ENV_INST_PREFIX ?= /usr
ENV_INST_LUADIR ?= $( ENV_INST_PREFIX) /share/lua/5.1
ENV_INST_BINDIR ?= $( ENV_INST_PREFIX) /bin
ENV_HOMEBREW_PREFIX ?= /usr/local
i f n e q ( $( shell whoami ) , r o o t )
ENV_LUAROCKS_FLAG_LOCAL := --local
2021-10-13 09:02:09 +08:00
e n d i f
2021-10-22 14:15:33 +08:00
i f d e f E N V _ L U A R O C K S _ S E R V E R
ENV_LUAROCKS_SERVER_OPT := --server $( ENV_LUAROCKS_SERVER)
e n d i f
2021-10-13 09:02:09 +08:00
2021-10-22 14:15:33 +08:00
# Execute only in the presence of ENV_NGINX_EXEC to avoid unexpected error output
i f n e q ( $( ENV_NGINX_EXEC ) , )
ENV_NGINX_PREFIX := $( shell $( ENV_NGINX_EXEC) -V 2>& 1 | grep -Eo 'prefix=(.*)/nginx\s+' | grep -Eo '/.*/' )
# OpenResty 1.17.8 or higher version uses openssl111 as the openssl dirname.
ifeq ( $( shell test -d $( addprefix $( ENV_NGINX_PREFIX) , openssl111) && echo -n yes) , yes)
ENV_OPENSSL_PREFIX := $( addprefix $( ENV_NGINX_PREFIX) , openssl111)
endif
2021-02-20 20:28:21 +08:00
e n d i f
2019-05-06 18:17:29 +08:00
2021-10-22 14:15:33 +08:00
# ENV patch for darwin
2021-10-13 09:02:09 +08:00
i f e q ( $( ENV_OS_NAME ) , d a r w i n )
ifeq ( $( ENV_OS_ARCH) , arm64)
2021-10-22 14:15:33 +08:00
ENV_HOMEBREW_PREFIX := /opt/homebrew
2021-10-13 09:02:09 +08:00
endif
2021-10-22 14:15:33 +08:00
# OSX archive `._` cache file
ENV_TAR := COPYFILE_DISABLE = 1 $( ENV_TAR)
ENV_LUAROCKS := $( ENV_LUAROCKS) --lua-dir= $( ENV_HOMEBREW_PREFIX) /opt/lua@5.1
ifeq ( $( shell test -d $( ENV_HOMEBREW_PREFIX) /opt/openresty-openssl && echo -n yes) , yes)
ENV_OPENSSL_PREFIX := $( ENV_HOMEBREW_PREFIX) /opt/openresty-openssl
2021-10-13 09:02:09 +08:00
endif
2021-10-22 14:15:33 +08:00
ifeq ( $( shell test -d $( ENV_HOMEBREW_PREFIX) /opt/openresty-openssl111 && echo -n yes) , yes)
ENV_OPENSSL_PREFIX := $( ENV_HOMEBREW_PREFIX) /opt/openresty-openssl111
2021-10-13 09:02:09 +08:00
endif
2021-03-08 17:13:39 +08:00
e n d i f
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
d e f i n e f u n c _ e c h o _ s t a t u s
printf "[%b info %b] %s\n" " $( _color_blue) " " $( _color_wipe) " $( 1)
e n d e f
d e f i n e f u n c _ e c h o _ w a r n _ s t a t u s
printf "[%b info %b] %s\n" " $( _color_yellow) " " $( _color_wipe) " $( 1)
e n d e f
2019-06-11 12:21:49 +08:00
2021-10-13 09:02:09 +08:00
d e f i n e f u n c _ e c h o _ s u c c e s s _ s t a t u s
printf "[%b info %b] %s\n" " $( _color_green) " " $( _color_wipe) " $( 1)
e n d e f
d e f i n e f u n c _ c h e c k _ f o l d e r
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
e n d e f
# Makefile target
.PHONY : runtime
runtime :
2021-10-22 14:15:33 +08:00
i f e q ( $( ENV_NGINX_EXEC ) , )
2019-11-26 21:24:45 +08:00
i f e q ( "$(wildcard /usr/local/openresty-debug/bin/openresty)" , "" )
2021-10-22 14:15:33 +08:00
@$( call func_echo_warn_status, "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
e l s e
2021-10-22 14:15:33 +08:00
$( eval ENV_NGINX_EXEC := /usr/local/openresty-debug/bin/openresty)
@$( call func_echo_status, "Use openresty-debug as default runtime" )
2019-11-25 13:09:32 +08:00
e n d i f
2019-11-26 21:24:45 +08:00
e n d i f
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
2021-10-22 14:15:33 +08:00
$( eval ENV_LUAROCKS_VER := $( shell $( ENV_LUAROCKS) --version | grep -E -o "luarocks [0-9]+." ) )
@if [ '$(ENV_LUAROCKS_VER)' = 'luarocks 3.' ] ; then \
mkdir -p ~/.luarocks; \
$( ENV_LUAROCKS) config $( ENV_LUAROCKS_FLAG_LOCAL) variables.OPENSSL_LIBDIR $( addprefix $( ENV_OPENSSL_PREFIX) , /lib) ; \
$( ENV_LUAROCKS) config $( ENV_LUAROCKS_FLAG_LOCAL) variables.OPENSSL_INCDIR $( addprefix $( ENV_OPENSSL_PREFIX) , /include) ; \
$( ENV_LUAROCKS) install rockspec/apisix-master-0.rockspec --tree= deps --only-deps --local $( ENV_LUAROCKS_SERVER_OPT) ; \
else \
2021-12-18 08:29:57 +08:00
$( call func_echo_warn_status, "WARNING: You're not using LuaRocks 3.x; please remove the luarocks and reinstall it via https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh" ) ; \
exit 1; \
2021-10-22 14:15:33 +08:00
fi
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
i f e q ( "$(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
e n d i f
2021-01-18 10:27:28 +08:00
i f e q ( "$(wildcard utils/reindex)" , "" )
wget -P utils https://raw.githubusercontent.com/iresty/openresty-devel-utils/master/reindex
chmod a+x utils/reindex
e n d i f
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
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d /usr/local/apisix/
$( ENV_INSTALL) -d /usr/local/apisix/logs/
$( ENV_INSTALL) -d /usr/local/apisix/conf/cert
$( ENV_INSTALL) conf/mime.types /usr/local/apisix/conf/mime.types
$( ENV_INSTALL) conf/config.yaml /usr/local/apisix/conf/config.yaml
$( ENV_INSTALL) conf/config-default.yaml /usr/local/apisix/conf/config-default.yaml
$( ENV_INSTALL) conf/debug.yaml /usr/local/apisix/conf/debug.yaml
$( ENV_INSTALL) conf/cert/* /usr/local/apisix/conf/cert/
2019-06-04 20:53:58 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix
$( ENV_INSTALL) apisix/*.lua $( ENV_INST_LUADIR) /apisix/
2019-10-08 16:46:53 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/admin
$( ENV_INSTALL) apisix/admin/*.lua $( ENV_INST_LUADIR) /apisix/admin/
2019-06-05 15:06:28 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/balancer
$( ENV_INSTALL) apisix/balancer/*.lua $( ENV_INST_LUADIR) /apisix/balancer/
2020-06-19 12:46:20 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/control
$( ENV_INSTALL) apisix/control/*.lua $( ENV_INST_LUADIR) /apisix/control/
2020-12-18 16:40:17 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/core
$( ENV_INSTALL) apisix/core/*.lua $( ENV_INST_LUADIR) /apisix/core/
2019-10-08 16:46:53 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/core/dns
$( ENV_INSTALL) apisix/core/dns/*.lua $( ENV_INST_LUADIR) /apisix/core/dns
2021-02-25 09:42:31 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/cli
$( ENV_INSTALL) apisix/cli/*.lua $( ENV_INST_LUADIR) /apisix/cli/
2020-10-31 22:56:42 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/discovery
$( ENV_INSTALL) apisix/discovery/*.lua $( ENV_INST_LUADIR) /apisix/discovery/
2020-10-11 12:27:03 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/http
$( ENV_INSTALL) apisix/http/*.lua $( ENV_INST_LUADIR) /apisix/http/
2019-10-08 16:46:53 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/http/router
$( ENV_INSTALL) apisix/http/router/*.lua $( ENV_INST_LUADIR) /apisix/http/router/
2019-07-12 20:26:36 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins
$( ENV_INSTALL) apisix/plugins/*.lua $( ENV_INST_LUADIR) /apisix/plugins/
2019-09-06 15:51:50 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/ext-plugin
$( ENV_INSTALL) apisix/plugins/ext-plugin/*.lua $( ENV_INST_LUADIR) /apisix/plugins/ext-plugin/
2021-04-23 09:16:51 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/grpc-transcode
$( ENV_INSTALL) apisix/plugins/grpc-transcode/*.lua $( ENV_INST_LUADIR) /apisix/plugins/grpc-transcode/
2019-08-06 18:06:42 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/ip-restriction
$( ENV_INSTALL) apisix/plugins/ip-restriction/*.lua $( ENV_INST_LUADIR) /apisix/plugins/ip-restriction/
2021-07-21 07:09:44 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/limit-conn
$( ENV_INSTALL) apisix/plugins/limit-conn/*.lua $( ENV_INST_LUADIR) /apisix/plugins/limit-conn/
2021-07-13 13:17:52 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/limit-count
$( ENV_INSTALL) apisix/plugins/limit-count/*.lua $( ENV_INST_LUADIR) /apisix/plugins/limit-count/
2019-08-22 14:40:56 +08:00
2021-11-23 16:37:35 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/google-cloud-logging
$( ENV_INSTALL) apisix/plugins/google-cloud-logging/*.lua $( ENV_INST_LUADIR) /apisix/plugins/google-cloud-logging/
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/prometheus
$( ENV_INSTALL) apisix/plugins/prometheus/*.lua $( ENV_INST_LUADIR) /apisix/plugins/prometheus/
2019-10-08 13:15:48 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/proxy-cache
$( ENV_INSTALL) apisix/plugins/proxy-cache/*.lua $( ENV_INST_LUADIR) /apisix/plugins/proxy-cache/
2021-10-21 15:57:54 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/serverless
$( ENV_INSTALL) apisix/plugins/serverless/*.lua $( ENV_INST_LUADIR) /apisix/plugins/serverless/
2020-11-04 09:49:14 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/zipkin
$( ENV_INSTALL) apisix/plugins/zipkin/*.lua $( ENV_INST_LUADIR) /apisix/plugins/zipkin/
2019-06-04 20:53:58 +08:00
2021-12-13 10:00:40 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/opa
$( ENV_INSTALL) apisix/plugins/opa/*.lua $( ENV_INST_LUADIR) /apisix/plugins/opa/
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/ssl/router
$( ENV_INSTALL) apisix/ssl/router/*.lua $( ENV_INST_LUADIR) /apisix/ssl/router/
2020-10-11 12:27:03 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/stream/plugins
$( ENV_INSTALL) apisix/stream/plugins/*.lua $( ENV_INST_LUADIR) /apisix/stream/plugins/
2019-10-08 16:46:53 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/stream/router
$( ENV_INSTALL) apisix/stream/router/*.lua $( ENV_INST_LUADIR) /apisix/stream/router/
2019-10-08 16:46:53 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/utils
$( ENV_INSTALL) apisix/utils/*.lua $( ENV_INST_LUADIR) /apisix/utils/
2020-03-27 07:34:08 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) bin/apisix $( ENV_INST_BINDIR) /apisix
2021-02-16 12:14:46 +08:00
2021-10-22 14:15:33 +08:00
$( ENV_INSTALL) -d $( ENV_INST_LUADIR) /apisix/plugins/slslog
$( ENV_INSTALL) apisix/plugins/slslog/*.lua $( ENV_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
2021-10-22 14:15:33 +08:00
test : runtime
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-22 14:15:33 +08:00
@$( call func_echo_status, " $@ -> [ Start ] " )
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
2021-10-22 14:15:33 +08:00
$( call func_check_folder,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-11-30 12:58:36 +08:00
./utils/gen-vote-contents.sh $( VERSION)
2021-10-22 14:15:33 +08:00
@$( call func_echo_success_status, " $@ -> [ Done ] " )
2021-10-13 09:02:09 +08:00
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-11-23 21:08:33 +08:00
# The $VERSION can be major.minor.patch (from developer)
# or major.minor (from the branch name in the CI)
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-11-23 21:08:33 +08:00
./rockspec/apisix-$( 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
2021-10-22 14:15:33 +08:00
### ci-env-up : CI env launch
2021-10-13 09:02:09 +08:00
.PHONY : ci -env -up
ci-env-up :
@$( call func_echo_status, " $@ -> [ Start ] " )
$( ENV_DOCKER_COMPOSE) up -d
@$( call func_echo_success_status, " $@ -> [ Done ] " )
2021-10-22 14:15:33 +08:00
### ci-env-ps : CI env ps
2021-10-13 09:02:09 +08:00
.PHONY : ci -env -ps
ci-env-ps :
@$( call func_echo_status, " $@ -> [ Start ] " )
$( ENV_DOCKER_COMPOSE) ps
@$( call func_echo_success_status, " $@ -> [ Done ] " )
2021-10-22 14:15:33 +08:00
### ci-env-rebuild : CI env image rebuild
2021-10-13 09:02:09 +08:00
.PHONY : ci -env -rebuild
ci-env-rebuild :
@$( call func_echo_status, " $@ -> [ Start ] " )
$( ENV_DOCKER_COMPOSE) build
@$( call func_echo_success_status, " $@ -> [ Done ] " )
2021-10-22 14:15:33 +08:00
### ci-env-down : CI env destroy
2021-10-13 09:02:09 +08:00
.PHONY : ci -env -down
ci-env-down :
@$( call func_echo_status, " $@ -> [ Start ] " )
$( ENV_DOCKER_COMPOSE) down
@$( call func_echo_success_status, " $@ -> [ Done ] " )