From 1b8e04e07db9a6bec8c37575f638819eb1713246 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Mon, 25 Sep 2023 11:43:23 +0530 Subject: [PATCH] fix: readd the apisix.yaml in entrypoint script Signed-off-by: Ashish Tiwari --- centos/docker-entrypoint.sh | 10 +++++++--- debian-dev/docker-entrypoint.sh | 10 +++++++--- debian/docker-entrypoint.sh | 10 +++++++--- redhat/docker-entrypoint.sh | 10 +++++++--- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/centos/docker-entrypoint.sh b/centos/docker-entrypoint.sh index d3deef62..3817756e 100755 --- a/centos/docker-entrypoint.sh +++ b/centos/docker-entrypoint.sh @@ -23,15 +23,19 @@ PREFIX=${APISIX_PREFIX:=/usr/local/apisix} if [[ "$1" == "docker-start" ]]; then if [ "$APISIX_STAND_ALONE" = "true" ]; then # If the file is not present then initialise the content otherwise update relevant keys for standalone mode + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi if [ ! -f "${PREFIX}/conf/config.yaml" ]; then cat > ${PREFIX}/conf/config.yaml << _EOC_ 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 \ diff --git a/debian-dev/docker-entrypoint.sh b/debian-dev/docker-entrypoint.sh index a451a1c5..e16a5614 100755 --- a/debian-dev/docker-entrypoint.sh +++ b/debian-dev/docker-entrypoint.sh @@ -23,15 +23,19 @@ PREFIX=${APISIX_PREFIX:=/usr/local/apisix} if [[ "$1" == "docker-start" ]]; then if [ "$APISIX_STAND_ALONE" = "true" ]; then # If the file is not present then initialise the content otherwise update relevant keys for standalone mode + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi if [ ! -f "${PREFIX}/conf/config.yaml" ]; then cat > ${PREFIX}/conf/config.yaml << _EOC_ 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 \ diff --git a/debian/docker-entrypoint.sh b/debian/docker-entrypoint.sh index d3deef62..3817756e 100755 --- a/debian/docker-entrypoint.sh +++ b/debian/docker-entrypoint.sh @@ -23,15 +23,19 @@ PREFIX=${APISIX_PREFIX:=/usr/local/apisix} if [[ "$1" == "docker-start" ]]; then if [ "$APISIX_STAND_ALONE" = "true" ]; then # If the file is not present then initialise the content otherwise update relevant keys for standalone mode + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi if [ ! -f "${PREFIX}/conf/config.yaml" ]; then cat > ${PREFIX}/conf/config.yaml << _EOC_ 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 \ diff --git a/redhat/docker-entrypoint.sh b/redhat/docker-entrypoint.sh index d3deef62..3817756e 100755 --- a/redhat/docker-entrypoint.sh +++ b/redhat/docker-entrypoint.sh @@ -23,15 +23,19 @@ PREFIX=${APISIX_PREFIX:=/usr/local/apisix} if [[ "$1" == "docker-start" ]]; then if [ "$APISIX_STAND_ALONE" = "true" ]; then # If the file is not present then initialise the content otherwise update relevant keys for standalone mode + if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then + cat > ${PREFIX}/conf/apisix.yaml << _EOC_ +routes: + - +#END +_EOC_ + fi if [ ! -f "${PREFIX}/conf/config.yaml" ]; then cat > ${PREFIX}/conf/config.yaml << _EOC_ 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 \