run_doxygen_testsuite: fix SELinux contexts so that the web server can offer the files (#8432)

This commit is contained in:
Sebastien Loriot 2024-08-26 15:20:40 +02:00 committed by GitHub
commit f32c7b015d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 6 deletions

View File

@ -6,7 +6,7 @@ cd /home/cgal-testsuite
# Rotate log files on one month: the logfile name contains the number of
# the day
LOGFILE=$PWD/doxygen_testsuite-`date '+%d'`.log
LOGFILE=$PWD/doxygen_testsuite-$(date '+%d').log
exec > "$LOGFILE"
@ -31,8 +31,8 @@ if [ -r "${CGAL_DOC_BUILD}" ]; then
rm -rf "${CGAL_DOC_BUILD}"
fi
mkdir ${CGAL_DOC_BUILD}
cd ${CGAL_DOC_BUILD}
mkdir "${CGAL_DOC_BUILD}"
cd "${CGAL_DOC_BUILD}"
if [ -r "LATEST" ]; then
rm -rf LATEST
@ -44,12 +44,12 @@ if [ ! -f "LATEST" ]; then
error "COULD NOT DOWNLOAD LATEST!"
fi
for i in `cat LATEST`
for i in $(cat LATEST)
do
CGAL_LOCATION="${CGAL_URL}/${i}";
CGAL_ZIPFILE="${i}";
done
CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.gz//"`
CGAL_RELEASE_ID=$(echo "$CGAL_ZIPFILE" | sed "s/.tar.gz//")
curl ${CURL_OPTS} "${CGAL_LOCATION}"
tar xvzf "${CGAL_ZIPFILE}" && rm "${CGAL_ZIPFILE}"
@ -60,11 +60,16 @@ cd "${CGAL_RELEASE_ID}"
PATH=/home/cgal-testsuite/local/bin:$PATH
export PATH
cd "$PWD/doc/scripts"
cd "${PWD}/doc/scripts"
bash -$- ./process_doc.sh /home/cgal-testsuite/bin/doxygen_1_8_13 /home/cgal-testsuite/bin/doxygen_1_9_6 /srv/CGAL/www/Members/Manual_doxygen_test
if head -2 ../../.scm-branch | grep -q cgal/master; then
rsync -a --delete "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}/output2/" /srv/CGAL/www/doc/master/
fi
if sestatus &>/dev/null && [ -d "/srv/CGAL/www/doc/master/" ] && [ -d "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}" ]; then
restorecon -R /srv/CGAL/www/doc/master/ /srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID} || error "restorecon command failed"
else
error "SELinux is not enabled or the paths do not exist"
fi
rm -rf "${CGAL_DOC_BUILD}"
# Then gzip the log file, to save space
exec