Make raw copy or hardlink instead of symlink, mainly for container test usage

This commit is contained in:
nemunaire 2014-11-21 10:24:13 +01:00
parent 84c3fdd8fa
commit 016d530b57
2 changed files with 14 additions and 2 deletions

View File

@ -60,4 +60,4 @@ RUN chmod 777 /var/www/fic-server/onyx/cache/ /var/www/fic-server/onyx/cache/tem
EXPOSE 80/tcp 443/tcp
VOLUME ["/var/www/fic-server/out","/var/www/fic-server/files","/var/www/fic-server/submissions"]
CMD ["sh", "-c", "chown -R www-data:www-data /var/www/fic-server/misc /var/www/fic-server/submission; cd /var/www/fic-server/misc; if ! [ -f server.crt ]; then bash ./CA.sh -newserver; fi; service nginx start && service php5-fpm start && service mysql start && mkdir files && ../gen_hash_link_files.sh ../files-in ../files && (../launch_local.sh &); /bin/bash"]
CMD ["sh", "-c", "chown -R www-data:www-data /var/www/fic-server/misc /var/www/fic-server/submission; cd /var/www/fic-server/misc; if ! [ -f server.crt ]; then bash ./CA.sh -newserver; fi; service nginx start && service php5-fpm start && service mysql start && mkdir files && ../gen_hash_link_files.sh --copy ../files-in ../files && (../launch_local.sh &); /bin/bash"]

View File

@ -6,6 +6,18 @@ then
exit 1
fi
if [ "$1" = "--hard" ]
then
LN="ln"
shift
elif [ "$1" = "--copy" ]
then
LN="cp"
shift
else
LN="ln -s"
fi
FROM=`realpath $1`; shift
TO=`realpath $1`; shift
@ -28,5 +40,5 @@ do
HASH=`echo -n $FILE | sha384sum | cut -d " " -f 1`
mkdir -p "$TO/$HASH/"
ln -s "$i" "$TO/$HASH/"
$LN "$i" "$TO/$HASH/"
done