🎨 Unify use of YAML syntax
This commit is contained in:
parent
a6d455580a
commit
201e838d17
18
Taskfile.yml
18
Taskfile.yml
|
@ -37,9 +37,9 @@ tasks:
|
||||||
- > # download OpenRefine archive
|
- > # download OpenRefine archive
|
||||||
wget --no-verbose -O openrefine.tar.gz
|
wget --no-verbose -O openrefine.tar.gz
|
||||||
https://github.com/OpenRefine/OpenRefine/releases/download/3.4.1/openrefine-linux-3.4.1.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
|
tar -xzf openrefine.tar.gz -C openrefine --strip 1
|
||||||
&& rm openrefine.tar.gz
|
rm openrefine.tar.gz
|
||||||
- | # optimize OpenRefine for batch processing
|
- | # 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 '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
|
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
|
- > # download openrefine-client into subdirectory openrefine
|
||||||
wget --no-verbose -O openrefine/client
|
wget --no-verbose -O openrefine/client
|
||||||
https://github.com/opencultureconsulting/openrefine-client/releases/download/v0.3.10/openrefine-client_0-3-10_linux
|
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:
|
start:
|
||||||
dir: ./{{.DIR}}
|
dir: ./{{.DIR}}
|
||||||
cmds:
|
cmds:
|
||||||
- | # check install and delete any temporary OpenRefine files
|
- | # verify that OpenRefine is installed
|
||||||
if [ ! -f "$OPENREFINE" ]; then
|
if [ ! -f "$OPENREFINE" ]; then
|
||||||
echo 1>&2 "OpenRefine missing; try task install"; exit 1
|
echo 1>&2 "OpenRefine missing; try task install"; exit 1
|
||||||
fi
|
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
|
- > # launch OpenRefine with specific data directory and redirect its output to a log file
|
||||||
"$OPENREFINE" -v warn -p {{.PORT}} -m {{.RAM}}
|
"$OPENREFINE" -v warn -p {{.PORT}} -m {{.RAM}}
|
||||||
-d ../{{.DIR}}
|
-d ../{{.DIR}}
|
||||||
|
@ -70,16 +72,16 @@ tasks:
|
||||||
stop:
|
stop:
|
||||||
dir: ./{{.DIR}}
|
dir: ./{{.DIR}}
|
||||||
cmds:
|
cmds:
|
||||||
- | # shut down OpenRefine
|
- | # shut down OpenRefine gracefully
|
||||||
PID=$(lsof -t -i:{{.PORT}})
|
PID=$(lsof -t -i:{{.PORT}})
|
||||||
kill $PID
|
kill $PID
|
||||||
while ps -p $PID > /dev/null; do sleep 1; done
|
while ps -p $PID > /dev/null; do sleep 1; done
|
||||||
- > # archive the OpenRefine project and delete temporary files
|
- > # archive the OpenRefine project
|
||||||
tar cfz
|
tar cfz
|
||||||
"{{.PROJECT}}.openrefine.tar.gz"
|
"{{.PROJECT}}.openrefine.tar.gz"
|
||||||
-C $(grep -l "{{.PROJECT}}" *.project/metadata.json | cut -d '/' -f 1)
|
-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:
|
check:
|
||||||
desc: check OpenRefine log for any warnings and exit on error
|
desc: check OpenRefine log for any warnings and exit on error
|
||||||
|
|
|
@ -32,8 +32,8 @@ tasks:
|
||||||
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
||||||
--apply config/doaj-openrefine.json
|
--apply config/doaj-openrefine.json
|
||||||
> {{.LOG}}
|
> {{.LOG}}
|
||||||
|
- mkdir -p output
|
||||||
- > # export to file
|
- > # export to file
|
||||||
mkdir -p output &&
|
|
||||||
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
||||||
--output "$(readlink -m output/doaj-results.tsv)"
|
--output "$(readlink -m output/doaj-results.tsv)"
|
||||||
> {{.LOG}}
|
> {{.LOG}}
|
||||||
|
|
|
@ -31,8 +31,8 @@ tasks:
|
||||||
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
||||||
--apply config/duplicates-deletion.json
|
--apply config/duplicates-deletion.json
|
||||||
> {{.LOG}}
|
> {{.LOG}}
|
||||||
|
- mkdir -p output
|
||||||
- > # export to file
|
- > # export to file
|
||||||
mkdir -p output &&
|
|
||||||
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
||||||
--output "$(readlink -m output/deduped.xls)"
|
--output "$(readlink -m output/deduped.xls)"
|
||||||
> {{.LOG}}
|
> {{.LOG}}
|
||||||
|
|
|
@ -34,8 +34,8 @@ tasks:
|
||||||
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
||||||
--apply config/phm-transform.json
|
--apply config/phm-transform.json
|
||||||
> {{.LOG}}
|
> {{.LOG}}
|
||||||
|
- mkdir -p output
|
||||||
- > # export to file
|
- > # export to file
|
||||||
mkdir -p output &&
|
|
||||||
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
"$CLIENT" -P {{.PORT}} "{{.PROJECT}}"
|
||||||
--output "$(readlink -m output/phm-results.tsv)"
|
--output "$(readlink -m output/phm-results.tsv)"
|
||||||
> {{.LOG}}
|
> {{.LOG}}
|
||||||
|
|
Loading…
Reference in New Issue