Merge pull request #9061 from zmstone/0927-fix-allow-space-in-path
fix(bin/emqx): allow space in root path
This commit is contained in:
commit
71b0ab9166
|
@ -133,7 +133,10 @@ jobs:
|
||||||
pkg_name=$(basename _packages/${EMQX_NAME}/emqx-*.zip)
|
pkg_name=$(basename _packages/${EMQX_NAME}/emqx-*.zip)
|
||||||
unzip -q _packages/${EMQX_NAME}/$pkg_name
|
unzip -q _packages/${EMQX_NAME}/$pkg_name
|
||||||
gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
|
gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
|
||||||
./emqx/bin/emqx start || cat emqx/log/erlang.log.1
|
# test with a spaces in path
|
||||||
|
mv ./emqx "./emqx home/"
|
||||||
|
cd "./emqx home/"
|
||||||
|
./bin/emqx start || cat log/erlang.log.1
|
||||||
ready='no'
|
ready='no'
|
||||||
for i in {1..10}; do
|
for i in {1..10}; do
|
||||||
if curl -fs 127.0.0.1:18083 > /dev/null; then
|
if curl -fs 127.0.0.1:18083 > /dev/null; then
|
||||||
|
@ -144,12 +147,13 @@ jobs:
|
||||||
done
|
done
|
||||||
if [ "$ready" != "yes" ]; then
|
if [ "$ready" != "yes" ]; then
|
||||||
echo "Timed out waiting for emqx to be ready"
|
echo "Timed out waiting for emqx to be ready"
|
||||||
cat emqx/log/erlang.log.1
|
cat log/erlang.log.1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
./emqx/bin/emqx_ctl status
|
./bin/emqx_ctl status
|
||||||
./emqx/bin/emqx stop
|
./bin/emqx stop
|
||||||
rm -rf emqx
|
cd ..
|
||||||
|
rm -rf "emqx home"
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: macos
|
name: macos
|
||||||
|
|
28
bin/emqx
28
bin/emqx
|
@ -481,6 +481,16 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ "$IS_BOOT_COMMAND" = 'no' ]; then
|
||||||
|
# for non-boot commands, inspect vm.<time>.args for node name
|
||||||
|
# shellcheck disable=SC2012,SC2086
|
||||||
|
LATEST_VM_ARGS_FILE="$(ls -t "$RUNNER_DATA_DIR"/configs/vm.*.args 2>/dev/null | head -1)"
|
||||||
|
if [ -z "$LATEST_VM_ARGS_FILE" ]; then
|
||||||
|
echoerr "There is no vm.*.args config file found in '$RUNNER_DATA_DIR/configs/'"
|
||||||
|
echoerr "Please make sure the node is initialized (started for at least once)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$NAME_ARG" ]; then
|
if [ -z "$NAME_ARG" ]; then
|
||||||
NODENAME="${EMQX_NODE_NAME:-}"
|
NODENAME="${EMQX_NODE_NAME:-}"
|
||||||
|
@ -488,15 +498,7 @@ if [ -z "$NAME_ARG" ]; then
|
||||||
[ -z "$NODENAME" ] && [ -n "$EMQX_NAME" ] && [ -n "$EMQX_HOST" ] && NODENAME="${EMQX_NAME}@${EMQX_HOST}"
|
[ -z "$NODENAME" ] && [ -n "$EMQX_NAME" ] && [ -n "$EMQX_HOST" ] && NODENAME="${EMQX_NAME}@${EMQX_HOST}"
|
||||||
if [ -z "$NODENAME" ]; then
|
if [ -z "$NODENAME" ]; then
|
||||||
if [ "$IS_BOOT_COMMAND" = 'no' ]; then
|
if [ "$IS_BOOT_COMMAND" = 'no' ]; then
|
||||||
# for non-boot commands, inspect vm.<time>.args for node name
|
NODENAME="$(grep -E '^-name' "$LATEST_VM_ARGS_FILE" | awk '{print $2}')"
|
||||||
# shellcheck disable=SC2012,SC2086
|
|
||||||
LATEST_VM_ARGS="$(ls -t $RUNNER_DATA_DIR/configs/vm.*.args 2>/dev/null | head -1)"
|
|
||||||
if [ -z "$LATEST_VM_ARGS" ]; then
|
|
||||||
echoerr "For command $1, there is no vm.*.args config file found in $RUNNER_DATA_DIR/configs/"
|
|
||||||
echoerr "Please make sure the node is initialized (started for at least once)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
NODENAME="$(grep -E '^-name' "$LATEST_VM_ARGS" | awk '{print $2}')"
|
|
||||||
else
|
else
|
||||||
# for boot commands, inspect emqx.conf for node name
|
# for boot commands, inspect emqx.conf for node name
|
||||||
NODENAME=$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -i "$REL_DIR"/emqx.schema -c "$RUNNER_ETC_DIR"/emqx.conf get node.name)
|
NODENAME=$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -i "$REL_DIR"/emqx.schema -c "$RUNNER_ETC_DIR"/emqx.conf get node.name)
|
||||||
|
@ -531,13 +533,7 @@ if [ -z "$COOKIE" ]; then
|
||||||
if [ "$IS_BOOT_COMMAND" = 'yes' ]; then
|
if [ "$IS_BOOT_COMMAND" = 'yes' ]; then
|
||||||
COOKIE=$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -i "$REL_DIR"/emqx.schema -c "$RUNNER_ETC_DIR"/emqx.conf get node.cookie)
|
COOKIE=$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -i "$REL_DIR"/emqx.schema -c "$RUNNER_ETC_DIR"/emqx.conf get node.cookie)
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2012,SC2086
|
COOKIE="$(grep -E '^-setcookie' "$LATEST_VM_ARGS_FILE" | awk '{print $2}')"
|
||||||
LATEST_VM_ARGS="$(ls -t $RUNNER_DATA_DIR/configs/vm.*.args | head -1)"
|
|
||||||
if [ -z "$LATEST_VM_ARGS" ]; then
|
|
||||||
echo "For command $1, there is no vm.*.args config file found in $RUNNER_DATA_DIR/configs/"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
COOKIE="$(grep -E '^-setcookie' "$LATEST_VM_ARGS" | awk '{print $2}')"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue