ocrd-galley/build

50 lines
1.3 KiB
Text
Raw Normal View History

2019-06-24 16:36:19 +02:00
#!/bin/sh
2019-10-30 17:54:05 +01:00
DATA_SUBDIR=data
2019-08-21 11:54:01 +02:00
set -e
check_data_subdir() {
result=0
2019-10-30 17:54:05 +01:00
if git submodule status $DATA_SUBDIR | grep -q '^-'; then
echo "$DATA_SUBDIR/ is not an initialized submodule"; result=1
fi
if ! [ -e $DATA_SUBDIR/.git/annex ]; then
echo "$DATA_SUBDIR/ is not a git annex repository"; result=1
fi
if ! (cd $DATA_SUBDIR && git annex version | grep -q 'local repository version: 7'); then
echo "$DATA_SUBDIR/ is not a git annex repository version 7"; result=1
fi
if ! (cd $DATA_SUBDIR && git remote | grep -q '^nfs$'); then
echo "$DATA_SUBDIR/ has no git remote 'nfs'"; result=1
fi
2019-10-30 17:54:05 +01:00
return $result
}
2019-10-30 17:54:05 +01:00
download=0
if ! check_data_subdir; then
select choice in "Abort to manually fix $DATA_SUBDIR submodule" "Download data files from the web"; do
if [ $REPLY = 1 ]; then
echo "Suggested commands:"
echo
echo "git submodule update --init"
echo "(cd $DATA_SUBDIR && git annex init --version=7)"
echo "(cd $DATA_SUBDIR && git remote add nfs /<... path to ...>/GitNX-Repository/qurator/qurator-data)"
exit
else
download=1
fi
done
else
(
cd data
for f in "calamari-models/GT4HistOCR/*.ckpt*" "tesseract-models/GT4HistOCR/*.traineddata" "textline_detection/*.h5"; do
git annex get $f
git annex fsck $f
done
)
fi
2019-08-21 11:54:01 +02:00
2019-08-20 12:25:12 +02:00
docker build -t my_ocrd_workflow .