Using standardized conditions for starting transfair

This commit is contained in:
Gerhard Salvini 2024-03-19 09:07:56 +01:00
parent 0d1f425df0
commit b9b44d2530
2 changed files with 13 additions and 2 deletions

View File

@ -48,7 +48,18 @@ services:
restart: on-failure restart: on-failure
#command: sh -c "sleep 60 && rm -rf /app/test/* && ([ ! -f "/app/lock" && ] && java -jar transFAIR.jar && touch "/app/lock) && tail -f /dev/null" #command: sh -c "sleep 60 && rm -rf /app/test/* && ([ ! -f "/app/lock" && ] && java -jar transFAIR.jar && touch "/app/lock) && tail -f /dev/null"
#command: sh -c "sleep 60 && rm -rf /app/test/* && java -jar transFAIR.jar && tail -f /dev/null" #command: sh -c "sleep 60 && rm -rf /app/test/* && java -jar transFAIR.jar && tail -f /dev/null"
command: sh -c "echo listing /app/data && ls -la /app/data && /app/launch.sh" #command: sh -c "echo listing /app/data && ls -la /app/data && /app/launch.sh"
#command: sh -c "echo listing /app/data && ls -la /app/data && [ "$(ls -A /app/data)" ] && [ ! -f "/app/data/lock" ] && /app/launch.sh & tail -f /dev/null"
#command: sh -c "echo listing /app/data && ls -la /app/data && [ ! -z "$(ls -A /app/data)" ] && [ ! -f "/app/data/lock" ] && /app/launch.sh & tail -f /dev/null"
#command: bash -c "echo listing /app/data && ls -la /app/data && [ ! -z "$(ls -A /app/data)" ] && [ ! -f "/app/data/lock" ] && /app/launch.sh & tail -f /dev/null"
#command: bash -c "echo listing /app/data && ls -la /app/data && [ ! -f "/app/data/lock" ] && /app/launch.sh & tail -f /dev/null"
#command: bash -c "echo listing /app/data && ls -la /app/data && [ ! -z "$(find /app/data -mindepth 1 -maxdepth 1)" ] && [ ! -f "/app/data/lock" ] && /app/launch.sh & tail -f /dev/null"
#command: bash -c "echo listing /app/data && ls -la /app/data && [ ! -z $(ls -A /app/data) ] && [ ! -f /app/data/lock ] && /app/launch.sh & tail -f /dev/null"
#command: bash -c "echo listing /app/data && ls -la /app/data && [ ! -f /app/data/lock ] && /app/launch.sh & tail -f /dev/null" # works!
#command: bash -c "echo listing /app/data && ls -la /app/data && [ ! -z `ls -A /app/data` ] && [ ! -f /app/data/lock ] && /app/launch.sh & tail -f /dev/null"
#command: bash -c "echo listing /app/data && ls -la /app/data && [ -f /app/data/*.csv ] && [ ! -f /app/data/lock ] && /app/launch.sh & tail -f /dev/null" # works!
command: bash -c "echo listing /app/data && ls -la /app/data && [ -f /app/data/*.[cC][sS][vV] ] && [ ! -f /app/data/lock ] && /app/launch.sh & tail -f /dev/null"
#command: sh -c "echo listing /app/data && ls -la /app/data && [ ! -z $(ls -A /app/data) ] && [ ! -f /app/data/lock ] && /app/launch.sh & tail -f /dev/null"
#command: sh -c "rm -rf /app/test/* && java -jar transFAIR.jar" #command: sh -c "rm -rf /app/test/* && java -jar transFAIR.jar"
volumes: volumes:
#- /home/gerhard/Projects/EHDS2/PrototypeSpring2024/test/:/app/test/ #- /home/gerhard/Projects/EHDS2/PrototypeSpring2024/test/:/app/test/

View File

@ -284,7 +284,7 @@ function build_transfair() {
# #
# 1. There is no data lock file (which means that no ETL has yet been run) and # 1. There is no data lock file (which means that no ETL has yet been run) and
# 2. There is data available. # 2. There is data available.
if [ ! -f "../ecdc/data/lock" ] && [ ! -z "$(ls -A ../ecdc/data)" ]; then if [ -f ../ecdc/data/*.[cC][sS][vV] ] && [ ! -f ../ecdc/data/lock ]; then
cd $base_dir/transfair cd $base_dir/transfair
docker build --progress=plain -t samply/transfair --no-cache . docker build --progress=plain -t samply/transfair --no-cache .
cd - cd -