File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 44
55omero=/opt/omero/server/OMERO.server/bin/omero
66cd /opt/omero/server
7+ echo " Running importer in the background"
8+ sh -c " /tools/wait-on-login && /tools/import-all" &
79echo " Starting OMERO.server"
810exec $omero admin start --foreground
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ RUN curl -L -o /usr/local/bin/dumb-init \
2222 chmod +x /usr/local/bin/dumb-init
2323ADD entrypoint.sh /usr/local/bin/
2424ADD 50-config.py 60-database.sh 99-run.sh /startup/
25+ ADD wait-on-login import-all /tools/
26+ RUN mkdir /import && touch /import/test.fake
2527
2628USER omero-server
2729
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ import atexit
4+ import os
5+ import socket
6+ import sys
7+ import time
8+
9+
10+ OMERO_DIST = os .environ .get ("OMERO_DIST" , "/opt/omero/server/OMERO.server" )
11+ if not os .path .exists (OMERO_DIST ):
12+ OMERO_DIST = "/opt/omero/web/OMERO.web"
13+
14+ sys .path .append ("/" .join ([OMERO_DIST , "lib/python" ]))
15+ import omero
16+ from omero .cli import cli_login
17+ from omero .util .import_candidates import as_dictionary
18+
19+
20+ OMERO_HOST = os .environ .get ("OMERO_HOST" , "localhost" )
21+ OMERO_USER = os .environ .get ("OMERO_USER" , "root" )
22+ OMERO_PASS = os .environ .get ("OMERO_PASS" , "omero" )
23+ OMERO_PORT = int (os .environ .get ("OMERO_PORT" , "4064" ))
24+ SLEEP_TIME = int (os .environ .get ("SLEEP_TIME" , "30" ))
25+
26+
27+ with cli_login ("-s" , OMERO_HOST ,
28+ "-u" , OMERO_USER ,
29+ "-p" , str (OMERO_PORT ),
30+ "-w" , OMERO_PASS ) as cli :
31+
32+ for k , v in as_dictionary (("/import" ,)).items ():
33+ cli .onecmd (["import" , k ])
You can’t perform that action at this time.
0 commit comments