forked from ome/omero-server-docker
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_processor.sh
executable file
·27 lines (20 loc) · 907 Bytes
/
test_processor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -e
set -u
set -x
# Must be exported by the caller:
# OMERO_USER OMERO_PASS PREFIX
OMERO=/opt/omero/server/OMERO.server/bin/omero
DSNAME=$(date +%Y%m%d-%H%M%S-%N)
FILENAME=$(date +%Y%m%d-%H%M%S-%N).fake
SCRIPT=/omero/util_scripts/Dataset_To_Plate.py
dataset_id=$(docker exec $PREFIX-master $OMERO obj -q -s localhost -u $OMERO_USER -w $OMERO_PASS new Dataset name=$DSNAME | cut -d: -f2)
docker exec $PREFIX-master sh -c \
"touch /tmp/$FILENAME && $OMERO import -d $dataset_id /tmp/$FILENAME"
docker exec $PREFIX-master $OMERO script launch $SCRIPT IDs=$dataset_id
echo "Completed with code $?"
result=$(docker exec $PREFIX-master $OMERO hql -q -s localhost -u $OMERO_USER -w $OMERO_PASS "SELECT COUNT(w) FROM WellSample w WHERE w.well.plate.name='$DSNAME' AND w.image.name='$FILENAME'" --style plain)
if [ "$result" != "0,1" ]; then
echo "Script failed: $result"
exit 2
fi