print server log if starting server fails (#102)

This commit is contained in:
Felix Lohmeier 2023-04-14 13:37:00 +02:00 committed by GitHub
parent 98ef70e29b
commit 6c47e108f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 36 deletions

28
orcli
View File

@ -1565,20 +1565,16 @@ orcli_test_command() {
trap '{ rm -rf "$OPENREFINE_TMPDIR"; rm -rf /tmp/jetty-127_0_0_1-3333*; kill -9 "$OPENREFINE_PID"; }' 0 2 3 15
# wait until OpenRefine is running (timeout 20s)
ready="n"
for i in {1..20}; do
sleep 1
if curl -fs "${OPENREFINE_URL}/command/core/get-version" &>/dev/null; then
ready="y"
log "started OpenRefine with tmp workspace ${OPENREFINE_TMPDIR}"
break
else
sleep 1
fi
if [[ $i == 20 ]]; then
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
fi
done
if [[ "$ready" == "y" ]]; then
log "started OpenRefine with tmp workspace ${OPENREFINE_TMPDIR}"
else
error "starting OpenRefine server failed!"
fi
# execute tests in subshell
export OPENREFINE_TMPDIR OPENREFINE_URL OPENREFINE_PID
@ -1860,20 +1856,16 @@ orcli_run_command() {
trap '{ rm -rf "$OPENREFINE_TMPDIR"; rm -rf /tmp/jetty-127_0_0_1-${OPENREFINE_URL##*:}*; kill -9 "$OPENREFINE_PID"; }' 0 2 3 15
# wait until OpenRefine is running (timeout 20s)
ready="n"
for i in {1..20}; do
sleep 1
if curl -fs "${OPENREFINE_URL}/command/core/get-version" &>/dev/null; then
ready="y"
log "started OpenRefine with tmp workspace ${OPENREFINE_TMPDIR}"
break
else
sleep 1
fi
if [[ $i == 20 ]]; then
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
fi
done
if [[ "$ready" == "y" ]]; then
log "started OpenRefine" "port: ${args[--port]}" "memory: ${args[--memory]}" "tmpdir: ${OPENREFINE_TMPDIR}" "pid: ${OPENREFINE_PID}"
else
error "starting OpenRefine server failed!"
fi
# execute script(s) in subshell
export OPENREFINE_TMPDIR OPENREFINE_URL OPENREFINE_PID

View File

@ -55,20 +55,16 @@ OPENREFINE_PID="$!"
trap '{ rm -rf "$OPENREFINE_TMPDIR"; rm -rf /tmp/jetty-127_0_0_1-${OPENREFINE_URL##*:}*; kill -9 "$OPENREFINE_PID"; }' 0 2 3 15
# wait until OpenRefine is running (timeout 20s)
ready="n"
for i in {1..20}; do
sleep 1
if curl -fs "${OPENREFINE_URL}/command/core/get-version" &>/dev/null; then
ready="y"
log "started OpenRefine with tmp workspace ${OPENREFINE_TMPDIR}"
break
else
sleep 1
fi
if [[ $i == 20 ]]; then
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
fi
done
if [[ "$ready" == "y" ]]; then
log "started OpenRefine" "port: ${args[--port]}" "memory: ${args[--memory]}" "tmpdir: ${OPENREFINE_TMPDIR}" "pid: ${OPENREFINE_PID}"
else
error "starting OpenRefine server failed!"
fi
# execute script(s) in subshell
export OPENREFINE_TMPDIR OPENREFINE_URL OPENREFINE_PID

View File

@ -35,20 +35,16 @@ OPENREFINE_PID="$!"
trap '{ rm -rf "$OPENREFINE_TMPDIR"; rm -rf /tmp/jetty-127_0_0_1-3333*; kill -9 "$OPENREFINE_PID"; }' 0 2 3 15
# wait until OpenRefine is running (timeout 20s)
ready="n"
for i in {1..20}; do
sleep 1
if curl -fs "${OPENREFINE_URL}/command/core/get-version" &>/dev/null; then
ready="y"
log "started OpenRefine with tmp workspace ${OPENREFINE_TMPDIR}"
break
else
sleep 1
fi
if [[ $i == 20 ]]; then
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
fi
done
if [[ "$ready" == "y" ]]; then
log "started OpenRefine with tmp workspace ${OPENREFINE_TMPDIR}"
else
error "starting OpenRefine server failed!"
fi
# execute tests in subshell
export OPENREFINE_TMPDIR OPENREFINE_URL OPENREFINE_PID