Skip to content

Commit

Permalink
fix: use sed replace yq (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamly authored Sep 28, 2023
1 parent bd073cf commit e0ac41c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Expand Down
9 changes: 4 additions & 5 deletions centos/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ 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
# 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
Expand Down
9 changes: 4 additions & 5 deletions debian-dev/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ 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
# 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
Expand Down
9 changes: 4 additions & 5 deletions debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ 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
# 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
Expand Down
9 changes: 4 additions & 5 deletions redhat/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ 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
# 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
Expand Down

0 comments on commit e0ac41c

Please sign in to comment.