Update gcube-start-container script to create gcube-data dirs

This commit is contained in:
Antonio Calanducci 2023-11-08 12:15:11 +01:00
parent 9800815d0a
commit a09e2c8b0b
1 changed files with 22 additions and 20 deletions

View File

@ -1,26 +1,28 @@
#! /bin/bash
if [ -n "$EXIST_HOME" ]; then
# our container is running a IS Collector
if [ -L "$EXIST_HOME/webapp/WEB-INF/data" ] ; then
# exist data has been already mounted on NFS
echo "eXist data should be already in place on NFS"
elif [ -d "$EXIST_HOME/webapp/WEB-INF/data" ] ; then
echo "First run: set up our directory structure on the NFS mountpoint"
mkdir -p /gcube-data/{db,backup} && mv $EXIST_HOME/webapp/WEB-INF/{data,logs,attachments} /gcube-data/db/
if [ $? -eq 0 ]; then
for dir in {data,logs,attachments}; do
ln -s /gcube-data/db/${dir} $EXIST_HOME/webapp/WEB-INF/${dir}
done
else
echo "Move failed: data already exists on NFS"
exit 1
fi
else
echo "Not a link, not a directory: a pony :-)?"
fi
fi
# if [ -n "$EXIST_HOME" ]; then
# # our container is running a IS Collector
# if [ -L "$EXIST_HOME/webapp/WEB-INF/data" ] ; then
# # exist data has been already mounted on NFS
# echo "eXist data should be already in place on NFS"
# elif [ -d "$EXIST_HOME/webapp/WEB-INF/data" ] ; then
# echo "First run: set up our directory structure on the NFS mountpoint"
# mkdir -p /gcube-data/{db,backup} && mv $EXIST_HOME/webapp/WEB-INF/{data,logs,attachments} /gcube-data/db/
# if [ $? -eq 0 ]; then
# for dir in {data,logs,attachments}; do
# ln -s /gcube-data/db/${dir} $EXIST_HOME/webapp/WEB-INF/${dir}
# done
# else
# echo "Move failed: data already exists on NFS"
# exit 1
# fi
# else
# echo "Not a link, not a directory: a pony :-)?"
# fi
# fi
mkdir -p /gcube-data/db/{data,logs,attachments}
if [ -z "$GLOBUS_LOCATION" ]