From 201e838d17f3947831ea254185b473c1f2e27406 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Thu, 25 Feb 2021 12:59:45 +0100 Subject: [PATCH] :art: Unify use of YAML syntax --- Taskfile.yml | 18 ++++++++++-------- example-doaj/Taskfile.yml | 2 +- example-duplicates/Taskfile.yml | 2 +- example-powerhouse/Taskfile.yml | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index d19686c..b129b09 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -37,9 +37,9 @@ tasks: - > # download OpenRefine archive wget --no-verbose -O openrefine.tar.gz https://github.com/OpenRefine/OpenRefine/releases/download/3.4.1/openrefine-linux-3.4.1.tar.gz - - > # install OpenRefine into subdirectory openrefine + - | # install OpenRefine into subdirectory openrefine tar -xzf openrefine.tar.gz -C openrefine --strip 1 - && rm openrefine.tar.gz + rm openrefine.tar.gz - | # optimize OpenRefine for batch processing sed -i 's/cd `dirname $0`/cd "$(dirname "$0")"/' "openrefine/refine" # fix path issue in OpenRefine startup file sed -i '$ a JAVA_OPTIONS=-Drefine.headless=true' "openrefine/refine.ini" # do not try to open OpenRefine in browser @@ -47,16 +47,18 @@ tasks: - > # download openrefine-client into subdirectory openrefine wget --no-verbose -O openrefine/client https://github.com/opencultureconsulting/openrefine-client/releases/download/v0.3.10/openrefine-client_0-3-10_linux - && chmod +x openrefine/client + - chmod +x openrefine/client # make client executable start: dir: ./{{.DIR}} cmds: - - | # check install and delete any temporary OpenRefine files + - | # verify that OpenRefine is installed if [ ! -f "$OPENREFINE" ]; then echo 1>&2 "OpenRefine missing; try task install"; exit 1 fi - rm -rf ./*.project* workspace.json "{{.PROJECT}}.log" + - | # delete temporary files and log file of previous run + rm -rf ./*.project* workspace.json + rm -rf "{{.PROJECT}}.log" - > # launch OpenRefine with specific data directory and redirect its output to a log file "$OPENREFINE" -v warn -p {{.PORT}} -m {{.RAM}} -d ../{{.DIR}} @@ -70,16 +72,16 @@ tasks: stop: dir: ./{{.DIR}} cmds: - - | # shut down OpenRefine + - | # shut down OpenRefine gracefully PID=$(lsof -t -i:{{.PORT}}) kill $PID while ps -p $PID > /dev/null; do sleep 1; done - - > # archive the OpenRefine project and delete temporary files + - > # archive the OpenRefine project tar cfz "{{.PROJECT}}.openrefine.tar.gz" -C $(grep -l "{{.PROJECT}}" *.project/metadata.json | cut -d '/' -f 1) . - && rm -rf ./*.project* workspace.json + - rm -rf ./*.project* workspace.json # delete temporary files check: desc: check OpenRefine log for any warnings and exit on error diff --git a/example-doaj/Taskfile.yml b/example-doaj/Taskfile.yml index fa69470..8151592 100644 --- a/example-doaj/Taskfile.yml +++ b/example-doaj/Taskfile.yml @@ -32,8 +32,8 @@ tasks: "$CLIENT" -P {{.PORT}} "{{.PROJECT}}" --apply config/doaj-openrefine.json > {{.LOG}} + - mkdir -p output - > # export to file - mkdir -p output && "$CLIENT" -P {{.PORT}} "{{.PROJECT}}" --output "$(readlink -m output/doaj-results.tsv)" > {{.LOG}} diff --git a/example-duplicates/Taskfile.yml b/example-duplicates/Taskfile.yml index 48f9813..f541804 100644 --- a/example-duplicates/Taskfile.yml +++ b/example-duplicates/Taskfile.yml @@ -31,8 +31,8 @@ tasks: "$CLIENT" -P {{.PORT}} "{{.PROJECT}}" --apply config/duplicates-deletion.json > {{.LOG}} + - mkdir -p output - > # export to file - mkdir -p output && "$CLIENT" -P {{.PORT}} "{{.PROJECT}}" --output "$(readlink -m output/deduped.xls)" > {{.LOG}} diff --git a/example-powerhouse/Taskfile.yml b/example-powerhouse/Taskfile.yml index 524dc1b..f3afd2f 100644 --- a/example-powerhouse/Taskfile.yml +++ b/example-powerhouse/Taskfile.yml @@ -34,8 +34,8 @@ tasks: "$CLIENT" -P {{.PORT}} "{{.PROJECT}}" --apply config/phm-transform.json > {{.LOG}} + - mkdir -p output - > # export to file - mkdir -p output && "$CLIENT" -P {{.PORT}} "{{.PROJECT}}" --output "$(readlink -m output/phm-results.tsv)" > {{.LOG}}