Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use sed replace yq #508

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
kamly marked this conversation as resolved.
Show resolved Hide resolved
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
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
Loading