From 39145b409bfc8f9a3883a6008031d3e256feeed7 Mon Sep 17 00:00:00 2001 From: kamly <121368588@qq.com> Date: Tue, 26 Sep 2023 10:44:30 +0800 Subject: [PATCH] fix: overwrite apisix.yaml (#502) --- centos/docker-entrypoint.sh | 11 ++++++++--- debian-dev/docker-entrypoint.sh | 11 ++++++++--- debian/docker-entrypoint.sh | 11 ++++++++--- redhat/docker-entrypoint.sh | 11 ++++++++--- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/centos/docker-entrypoint.sh b/centos/docker-entrypoint.sh index d3deef62..cf5bd32b 100755 --- a/centos/docker-entrypoint.sh +++ b/centos/docker-entrypoint.sh @@ -29,9 +29,6 @@ deployment: role: data_plane role_data_plane: config_provider: yaml -routes: - - -#END _EOC_ else wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ @@ -40,6 +37,14 @@ _EOC_ /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml rm /usr/local/apisix/yq fi + + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi /usr/bin/apisix init else /usr/bin/apisix init diff --git a/debian-dev/docker-entrypoint.sh b/debian-dev/docker-entrypoint.sh index a451a1c5..70ae4487 100755 --- a/debian-dev/docker-entrypoint.sh +++ b/debian-dev/docker-entrypoint.sh @@ -29,9 +29,6 @@ deployment: role: data_plane role_data_plane: config_provider: yaml -routes: - - -#END _EOC_ else wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ @@ -40,6 +37,14 @@ _EOC_ /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml rm /usr/local/apisix/yq fi + + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi /usr/bin/apisix init else /usr/bin/apisix init diff --git a/debian/docker-entrypoint.sh b/debian/docker-entrypoint.sh index d3deef62..cf5bd32b 100755 --- a/debian/docker-entrypoint.sh +++ b/debian/docker-entrypoint.sh @@ -29,9 +29,6 @@ deployment: role: data_plane role_data_plane: config_provider: yaml -routes: - - -#END _EOC_ else wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ @@ -40,6 +37,14 @@ _EOC_ /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml rm /usr/local/apisix/yq fi + + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi /usr/bin/apisix init else /usr/bin/apisix init diff --git a/redhat/docker-entrypoint.sh b/redhat/docker-entrypoint.sh index d3deef62..cf5bd32b 100755 --- a/redhat/docker-entrypoint.sh +++ b/redhat/docker-entrypoint.sh @@ -29,9 +29,6 @@ deployment: role: data_plane role_data_plane: config_provider: yaml -routes: - - -#END _EOC_ else wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ @@ -40,6 +37,14 @@ _EOC_ /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml rm /usr/local/apisix/yq fi + + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi /usr/bin/apisix init else /usr/bin/apisix init