From 391c179e37a1512831b41423e8fa4a2836faddb3 Mon Sep 17 00:00:00 2001 From: Yuansheng Date: Mon, 14 Oct 2019 00:50:50 -0400 Subject: [PATCH 1/5] luarocks: support to install apisix without dashboard. --- .travis/linux_runner.sh | 2 +- Makefile | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis/linux_runner.sh b/.travis/linux_runner.sh index 9b2bab678c8c..91abe4bd6d3d 100755 --- a/.travis/linux_runner.sh +++ b/.travis/linux_runner.sh @@ -17,7 +17,7 @@ export_or_prefix() { } create_lua_deps() { - sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local + APISIX_WITHOUT_DASHBOARD=1 sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local sudo luarocks install --lua-dir=${OPENRESTY_PREFIX}/luajit lua-resty-libr3 --tree=deps --local echo "Create lua deps cache" sudo rm -rf build-cache/deps diff --git a/Makefile b/Makefile index 130342eb7e00..b92ec685533d 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ dev: ifeq ($(UNAME),Darwin) luarocks install --lua-dir=$(LUA_JIT_DIR) rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local else ifneq ($(LUAROCKS_VER),'luarocks 3.') - luarocks install rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local + APISIX_WITHOUT_DASHBOARD=1 luarocks install rockspec/apisix-dev-1.0-0.rockspec --tree=deps --local else luarocks install --lua-dir=/usr/local/openresty/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local endif @@ -99,6 +99,7 @@ reload: ### install: Install the apisix .PHONY: install install: +ifneq ($(APISIX_WITHOUT_DASHBOARD),1) $(INSTALL) -d /usr/local/apisix/dashboard cd `mktemp -d /tmp/apisix.XXXXXX` && \ git clone https://github.com/iresty/apisix.git && \ @@ -106,6 +107,7 @@ install: git submodule update --init --recursive && \ cp -r dashboard/* /usr/local/apisix/dashboard chmod -R 755 /usr/local/apisix/dashboard +endif $(INSTALL) -d /usr/local/apisix/logs/ $(INSTALL) -d /usr/local/apisix/conf/cert @@ -155,6 +157,7 @@ install: $(INSTALL) COPYRIGHT $(INST_CONFDIR)/COPYRIGHT $(INSTALL) README.md $(INST_CONFDIR)/README.md $(INSTALL) bin/apisix $(INST_BINDIR)/apisix + echo $(APISIX_WITHOUT_DASHBOARD) ### test: Run the test case From 04e151fc296f4dc0caa282c3b89ef412de7331d7 Mon Sep 17 00:00:00 2001 From: Yuansheng Date: Mon, 14 Oct 2019 00:51:00 -0400 Subject: [PATCH 2/5] change: only for test. --- rockspec/apisix-dev-1.0-0.rockspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rockspec/apisix-dev-1.0-0.rockspec b/rockspec/apisix-dev-1.0-0.rockspec index c74b25db16f0..02e65f61f847 100644 --- a/rockspec/apisix-dev-1.0-0.rockspec +++ b/rockspec/apisix-dev-1.0-0.rockspec @@ -4,7 +4,7 @@ supported_platforms = {"linux", "macosx"} source = { url = "git://github.com/iresty/apisix", - branch = "master", + branch = "install-apisix-without-dashboard", } description = { From 2c737dfc6092bd65c6102378e3d6f40fa2ed2548 Mon Sep 17 00:00:00 2001 From: Yuansheng Date: Mon, 14 Oct 2019 01:00:23 -0400 Subject: [PATCH 3/5] change: removed debug code. --- Makefile | 1 - rockspec/apisix-dev-1.0-0.rockspec | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b92ec685533d..45a6af8edfd8 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,6 @@ endif $(INSTALL) COPYRIGHT $(INST_CONFDIR)/COPYRIGHT $(INSTALL) README.md $(INST_CONFDIR)/README.md $(INSTALL) bin/apisix $(INST_BINDIR)/apisix - echo $(APISIX_WITHOUT_DASHBOARD) ### test: Run the test case diff --git a/rockspec/apisix-dev-1.0-0.rockspec b/rockspec/apisix-dev-1.0-0.rockspec index 02e65f61f847..c74b25db16f0 100644 --- a/rockspec/apisix-dev-1.0-0.rockspec +++ b/rockspec/apisix-dev-1.0-0.rockspec @@ -4,7 +4,7 @@ supported_platforms = {"linux", "macosx"} source = { url = "git://github.com/iresty/apisix", - branch = "install-apisix-without-dashboard", + branch = "master", } description = { From 9a9ea357302299bc48364995b4048892e1be3a4a Mon Sep 17 00:00:00 2001 From: Yuansheng Date: Mon, 14 Oct 2019 01:02:16 -0400 Subject: [PATCH 4/5] makefile: reverted some code. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 45a6af8edfd8..4650674891fb 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ dev: ifeq ($(UNAME),Darwin) luarocks install --lua-dir=$(LUA_JIT_DIR) rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local else ifneq ($(LUAROCKS_VER),'luarocks 3.') - APISIX_WITHOUT_DASHBOARD=1 luarocks install rockspec/apisix-dev-1.0-0.rockspec --tree=deps --local + APISIX_WITHOUT_DASHBOARD=1 luarocks install rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local else luarocks install --lua-dir=/usr/local/openresty/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local endif From bdda88ecdc2327d3f91254687101f458cd763a05 Mon Sep 17 00:00:00 2001 From: Yuansheng Date: Mon, 14 Oct 2019 02:35:26 -0400 Subject: [PATCH 5/5] change: name style. --- .travis/linux_runner.sh | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis/linux_runner.sh b/.travis/linux_runner.sh index 91abe4bd6d3d..bf1dfeb74e3a 100755 --- a/.travis/linux_runner.sh +++ b/.travis/linux_runner.sh @@ -17,7 +17,7 @@ export_or_prefix() { } create_lua_deps() { - APISIX_WITHOUT_DASHBOARD=1 sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local + WITHOUT_DASHBOARD=1 sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local sudo luarocks install --lua-dir=${OPENRESTY_PREFIX}/luajit lua-resty-libr3 --tree=deps --local echo "Create lua deps cache" sudo rm -rf build-cache/deps diff --git a/Makefile b/Makefile index 4650674891fb..6159b8777b7e 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ dev: ifeq ($(UNAME),Darwin) luarocks install --lua-dir=$(LUA_JIT_DIR) rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local else ifneq ($(LUAROCKS_VER),'luarocks 3.') - APISIX_WITHOUT_DASHBOARD=1 luarocks install rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local + WITHOUT_DASHBOARD=1 luarocks install rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local else luarocks install --lua-dir=/usr/local/openresty/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local endif @@ -99,7 +99,7 @@ reload: ### install: Install the apisix .PHONY: install install: -ifneq ($(APISIX_WITHOUT_DASHBOARD),1) +ifneq ($(WITHOUT_DASHBOARD),1) $(INSTALL) -d /usr/local/apisix/dashboard cd `mktemp -d /tmp/apisix.XXXXXX` && \ git clone https://github.com/iresty/apisix.git && \