deferred tasks don't fail
This commit is contained in:
parent
fceca60918
commit
d35b679f6d
18
Taskfile.yml
18
Taskfile.yml
|
@ -14,9 +14,10 @@ tasks:
|
||||||
default:
|
default:
|
||||||
desc: run workflow in batch mode
|
desc: run workflow in batch mode
|
||||||
cmds:
|
cmds:
|
||||||
- defer: { task: stop } # will always be executed last
|
- defer: { task: cleanup } # will always be executed last
|
||||||
- task: start
|
- task: start
|
||||||
- task: example
|
- task: example
|
||||||
|
- task: check
|
||||||
sources:
|
sources:
|
||||||
- Taskfile.yml
|
- Taskfile.yml
|
||||||
- input/**
|
- input/**
|
||||||
|
@ -48,17 +49,20 @@ tasks:
|
||||||
"${OPENREFINE_APPDIR}/client" example \
|
"${OPENREFINE_APPDIR}/client" example \
|
||||||
--output output/deduped.tsv
|
--output output/deduped.tsv
|
||||||
|
|
||||||
stop:
|
check:
|
||||||
- defer: rm -rf "${OPENREFINE_TMPDIR}"
|
- | # check log file for any warnings
|
||||||
|
if grep -i 'exception\|error' "${OPENREFINE_TMPDIR}/log.txt"
|
||||||
|
then echo 1>&2 "log contains warnings!"; echo; cat "${OPENREFINE_TMPDIR}/log.txt"; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cleanup:
|
||||||
- | # print stats and kill OpenRefine immediately
|
- | # print stats and kill OpenRefine immediately
|
||||||
PID="$(lsof -t -i:${OPENREFINE_PORT})"
|
PID="$(lsof -t -i:${OPENREFINE_PORT})"
|
||||||
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
|
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
|
||||||
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
|
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
|
||||||
kill -9 $PID
|
kill -9 $PID
|
||||||
- | # check log file for any warnings
|
- | # delete temporary files
|
||||||
if grep -i 'exception\|error' "${OPENREFINE_TMPDIR}/log.txt"
|
rm -rf "${OPENREFINE_TMPDIR}"
|
||||||
then echo 1>&2 "log contains warnings!"; echo; cat "${OPENREFINE_TMPDIR}/log.txt"; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
desc: install OpenRefine and openrefine-client into subdirectory ${OPENREFINE_APPDIR}
|
desc: install OpenRefine and openrefine-client into subdirectory ${OPENREFINE_APPDIR}
|
||||||
|
|
Loading…
Reference in New Issue