From 1950efee0d29a1c214dbd93cb20ddc54079585fe Mon Sep 17 00:00:00 2001 From: kamlyli Date: Wed, 27 Sep 2023 13:11:19 +0800 Subject: [PATCH 1/4] fix: use sed replace yq --- centos/docker-entrypoint.sh | 7 ++----- debian-dev/docker-entrypoint.sh | 7 ++----- debian/docker-entrypoint.sh | 7 ++----- redhat/docker-entrypoint.sh | 7 ++----- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/centos/docker-entrypoint.sh b/centos/docker-entrypoint.sh index cf5bd32b..230e4080 100755 --- a/centos/docker-entrypoint.sh +++ b/centos/docker-entrypoint.sh @@ -31,11 +31,8 @@ deployment: config_provider: yaml _EOC_ else - wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ - && chmod a+x /usr/local/apisix/yq - /usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml - /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml - rm /usr/local/apisix/yq + sed -i 's/role: traditional/role: data_plane/' config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/debian-dev/docker-entrypoint.sh b/debian-dev/docker-entrypoint.sh index 70ae4487..5c0b1c98 100755 --- a/debian-dev/docker-entrypoint.sh +++ b/debian-dev/docker-entrypoint.sh @@ -31,11 +31,8 @@ deployment: config_provider: yaml _EOC_ else - wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ - && chmod a+x /usr/local/apisix/yq - /usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml - /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml - rm /usr/local/apisix/yq + sed -i 's/role: traditional/role: data_plane/' config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/debian/docker-entrypoint.sh b/debian/docker-entrypoint.sh index cf5bd32b..230e4080 100755 --- a/debian/docker-entrypoint.sh +++ b/debian/docker-entrypoint.sh @@ -31,11 +31,8 @@ deployment: config_provider: yaml _EOC_ else - wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ - && chmod a+x /usr/local/apisix/yq - /usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml - /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml - rm /usr/local/apisix/yq + sed -i 's/role: traditional/role: data_plane/' config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/redhat/docker-entrypoint.sh b/redhat/docker-entrypoint.sh index cf5bd32b..230e4080 100755 --- a/redhat/docker-entrypoint.sh +++ b/redhat/docker-entrypoint.sh @@ -31,11 +31,8 @@ deployment: config_provider: yaml _EOC_ else - wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \ - && chmod a+x /usr/local/apisix/yq - /usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml - /usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml - rm /usr/local/apisix/yq + sed -i 's/role: traditional/role: data_plane/' config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then From 87139ebe580a3267bb1f79270b0bb42ccd9d0ec7 Mon Sep 17 00:00:00 2001 From: kamlyli Date: Wed, 27 Sep 2023 23:03:41 +0800 Subject: [PATCH 2/4] fix: reduce 30 --- .github/workflows/apisix-docker-example-test-standalone.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apisix-docker-example-test-standalone.yaml b/.github/workflows/apisix-docker-example-test-standalone.yaml index 78b0ea7c..fca5317d 100644 --- a/.github/workflows/apisix-docker-example-test-standalone.yaml +++ b/.github/workflows/apisix-docker-example-test-standalone.yaml @@ -60,7 +60,7 @@ jobs: - name: Test APISIX run: | - sleep 50 #startup time maybe a little longer as the yq binary is downloaded for use at runtime + sleep 30 #startup time maybe a little longer as the yq binary is downloaded for use at runtime result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get` if [[ $result_code -ne 200 ]];then From 898546a60b655f03d4920ce96d930d781afd9225 Mon Sep 17 00:00:00 2001 From: kamlyli Date: Thu, 28 Sep 2023 11:35:31 +0800 Subject: [PATCH 3/4] fix: sed --- centos/docker-entrypoint.sh | 6 ++++-- debian-dev/docker-entrypoint.sh | 6 ++++-- debian/docker-entrypoint.sh | 6 ++++-- redhat/docker-entrypoint.sh | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/centos/docker-entrypoint.sh b/centos/docker-entrypoint.sh index 230e4080..93565ef6 100755 --- a/centos/docker-entrypoint.sh +++ b/centos/docker-entrypoint.sh @@ -31,8 +31,10 @@ deployment: config_provider: yaml _EOC_ else - sed -i 's/role: traditional/role: data_plane/' config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml + # updating config.yaml for standalone mode + sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml + sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/debian-dev/docker-entrypoint.sh b/debian-dev/docker-entrypoint.sh index 5c0b1c98..b9d54c44 100755 --- a/debian-dev/docker-entrypoint.sh +++ b/debian-dev/docker-entrypoint.sh @@ -31,8 +31,10 @@ deployment: config_provider: yaml _EOC_ else - sed -i 's/role: traditional/role: data_plane/' config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml + # updating config.yaml for standalone mode + sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml + sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/debian/docker-entrypoint.sh b/debian/docker-entrypoint.sh index 230e4080..93565ef6 100755 --- a/debian/docker-entrypoint.sh +++ b/debian/docker-entrypoint.sh @@ -31,8 +31,10 @@ deployment: config_provider: yaml _EOC_ else - sed -i 's/role: traditional/role: data_plane/' config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml + # updating config.yaml for standalone mode + sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml + sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/redhat/docker-entrypoint.sh b/redhat/docker-entrypoint.sh index 230e4080..93565ef6 100755 --- a/redhat/docker-entrypoint.sh +++ b/redhat/docker-entrypoint.sh @@ -31,8 +31,10 @@ deployment: config_provider: yaml _EOC_ else - sed -i 's/role: traditional/role: data_plane/' config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml + # updating config.yaml for standalone mode + sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml + sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml + sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then From db171ad3561755a2c8336885123964b781655ea8 Mon Sep 17 00:00:00 2001 From: kamlyli Date: Thu, 28 Sep 2023 12:01:43 +0800 Subject: [PATCH 4/4] fix: remove comment --- .github/workflows/apisix-docker-example-test-standalone.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apisix-docker-example-test-standalone.yaml b/.github/workflows/apisix-docker-example-test-standalone.yaml index fca5317d..f9823c93 100644 --- a/.github/workflows/apisix-docker-example-test-standalone.yaml +++ b/.github/workflows/apisix-docker-example-test-standalone.yaml @@ -60,7 +60,7 @@ jobs: - name: Test APISIX run: | - sleep 30 #startup time maybe a little longer as the yq binary is downloaded for use at runtime + sleep 30 result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get` if [[ $result_code -ne 200 ]];then