This is an automated email from the ASF dual-hosted git repository.

monkeydluffy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-docker.git


The following commit(s) were added to refs/heads/master by this push:
     new 39145b4  fix: overwrite apisix.yaml (#502)
39145b4 is described below

commit 39145b409bfc8f9a3883a6008031d3e256feeed7
Author: kamly <[email protected]>
AuthorDate: Tue Sep 26 10:44:30 2023 +0800

    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 d3deef6..cf5bd32 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 a451a1c..70ae448 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 d3deef6..cf5bd32 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 d3deef6..cf5bd32 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

Reply via email to