Commit e8403806 authored by PENGUEN Julien's avatar PENGUEN Julien
Browse files

mise a jour de la version macos par rapport a la version linux (option --mount...

mise a jour de la version macos par rapport a la version linux (option --mount et verification presence fichiers input et volume à monter
parent 3aa0ed36
......@@ -25,6 +25,19 @@ function_message()
echo -e "WARNING => ${message}"
echo -e "=========================================================\033[0m"
elif [ "$type_message" == "TYPE_FILE_ERROR" ]; then
echo ""
echo "------------------------------------"
echo ""
echo -e "\033[31m========================================================="
echo -e " ERROR with option '${option}' "
echo -e ""
echo -e "${message}"
echo -e "=========================================================\033[0m"
echo ""
echo "------------------------------------"
elif [ "$type_message" == "TYPE_HELP" ]; then
echo ""
......@@ -152,8 +165,11 @@ function_message()
echo ""
echo "--angular run photos_montage_aladin with this angular dimension value instead of "
echo "the default angular value define on .env file. the angular value must be on second of arc"
echo "--resolution_col run photos_montage_aladin with this number of pixel by columns for the Image Magick montages"
echo "--resolution_line run photos_montage_aladin with this number of pixel by lines for the Image Magick montages"
echo "--resolution_col number run photos_montage_aladin with this number of pixel by columns for the Image Magick montages"
echo "--resolution_line number run photos_montage_aladin with this number of pixel by lines for the Image Magick montages"
echo "--nb_tile_col number run photos_montage_aladin with this number of tiles by columns for the Image Magick montages"
echo "--nb_tile_line number run photos_montage_aladin with this number of tiles by lines for the Image Magick montages"
echo "--mount path run photos_montage_aladin with a volume mounted on docker container repository /mnt"
echo ""
fi
......@@ -205,6 +221,7 @@ function_build_tab_hach()
ARRAY["--resolution_col"]="NUMBER";
ARRAY["--nb_tile_line"]="NUMBER";
ARRAY["--nb_tile_col"]="NUMBER";
ARRAY["--mount"]="PATH VOLUME";
# ---------------------- #
# ARRAY_WEIGHT[key]=value
......@@ -240,6 +257,7 @@ function_build_tab_hach()
ARGS_WEIGHT["--resolution_col"]=2;
ARGS_WEIGHT["--nb_tile_line"]=2;
ARGS_WEIGHT["--nb_tile_col"]=2;
ARGS_WEIGHT["--mount"]=2;
# -------- #
......@@ -500,7 +518,7 @@ case $taille in
elif [ "${tempo_arg_weight[0]}" -eq 2 ]; then
#case '--survey', '--area' ,'--angular'
#'--resolution_line', '--resolution_col',
#'--nb_tile_line','--nb_tile_col'
#'--nb_tile_line','--nb_tile_col','--mount'
tab2_arg_keys[0]="--no_select"
tab2_arg_values[0]="$ALADIN_VERSION"
......@@ -575,7 +593,7 @@ case $taille in
if [ "$tempo_weight_2" == 'TRUE' ]; then
#case '--survey', '--area' ,'--angular'
#'--resolution_line', '--resolution_col',
#'--nb_tile_line','--nb_tile_col'
#'--nb_tile_line','--nb_tile_col', '--mount'
tab2_arg_keys[0]="--no_select"
tab2_arg_values[0]="$ALADIN_VERSION"
......@@ -816,16 +834,48 @@ sort_arg_keys=( ${tab_sort_arg_keys// / } )
sort_arg_values=( ${tab_sort_arg_values// / } )
sort_arg_weight=( ${tab_sort_arg_weight// / } )
#------------------------------#
#check volume_mount input args
VOLUME_MOUNT=`function_check_and_replace "${sort_arg_keys[*]}" "${sort_arg_values[*]}" "--mount" $VOLUME_MOUNT`
if [[ -d $VOLUME_MOUNT && $VOLUME_MOUNT != "" ]]; then
echo "=> $VOLUME_MOUNT exist"
else
function_message "TYPE_FILE_ERROR" "$VOLUME_MOUNT not found" "--mount"
exit 0
fi
#------------------------------#
#check survey input args
INPUT_FILE_SURVEYS=`function_check_and_replace "${sort_arg_keys[*]}" "${sort_arg_values[*]}" "--survey" $INPUT_FILE_SURVEYS`
if [ -f $INPUT_FILE_SURVEYS ]; then
echo "=> $INPUT_FILE_SURVEYS exist"
else
function_message "TYPE_FILE_ERROR" "$INPUT_FILE_SURVEYS not found" "--survey"
exit 0
fi
#------------------------------#
#check area input args
INPUT_FILE_AREAS=`function_check_and_replace "${sort_arg_keys[*]}" "${sort_arg_values[*]}" "--area" $INPUT_FILE_AREAS`
if [ -f $INPUT_FILE_AREAS ]; then
echo "=> $INPUT_FILE_AREAS exist"
else
function_message "TYPE_FILE_ERROR" "$INPUT_FILE_AREAS not found" "--area"
exit 0
fi
#-------------------------------------#
#check angular input arg
......@@ -1167,7 +1217,11 @@ case ${sort_arg_keys[0]} in
script_montages[$k]="montage -geometry ${RESOLUTION_BY_LINE}x${RESOLUTION_BY_COL} -tile ${NB_TILE_BY_LINE}x${NB_TILE_BY_COL} ${images_folder[$k]}/*jpg ${montages_folder[$k]}/${list_zone[$k]}.png"
xhost +
docker run --name photos_montage_aladin --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /Users/$USER:/home/$USER --network host -e DISPLAY=host.docker.internal:0 -e USER=$USER -e HOME=/home/$USER image_photos_montage_aladin-${version} /bin/bash -c "java -jar /var/aladin/Aladin-${version}.jar -nogui -trace -script=${script_images[$k]};${script_montages[$k]} " > ${log_aladin_file[$k]} 2>&1
if [[ "${sort_arg_keys[@]}" =~ "--mount" && $VOLUME_MOUNT != "" ]]; then
docker run --name photos_montage_aladin --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /Users/$USER:/home/$USER -v ${VOLUME_MOUNT}:"/mnt/${VOLUME_MOUNT}" --network host -e DISPLAY=host.docker.internal:0 -e USER=$USER -e HOME=/home/$USER image_photos_montage_aladin-${version} /bin/bash -c "java -jar /var/aladin/Aladin-${version}.jar -nogui -trace -script=${script_images[$k]};${script_montages[$k]} " > ${log_aladin_file[$k]} 2>&1
else
docker run --name photos_montage_aladin --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /Users/$USER:/home/$USER --network host -e DISPLAY=host.docker.internal:0 -e USER=$USER -e HOME=/home/$USER image_photos_montage_aladin-${version} /bin/bash -c "java -jar /var/aladin/Aladin-${version}.jar -nogui -trace -script=${script_images[$k]};${script_montages[$k]} " > ${log_aladin_file[$k]} 2>&1
fi
xhost -
echo "=> Construction OK"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment