2020-05-19 22:36:10 +03:00
|
|
|
#!/bin/bash
|
|
|
|
#set -e
|
|
|
|
|
|
|
|
function createOptDirectory {
|
|
|
|
if [ ! -d $1 ]
|
|
|
|
then
|
|
|
|
echo "Creating " $1
|
|
|
|
mkdir -p $1
|
|
|
|
fi
|
|
|
|
|
|
|
|
chown -R www-data:www-data $1
|
|
|
|
}
|
|
|
|
|
2020-07-30 17:52:12 +03:00
|
|
|
/bin/cp -rf /testrail-release/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
|
|
|
|
|
|
|
echo "##############"
|
|
|
|
echo "Unzipping testrail"
|
|
|
|
unzip /testrail-release/testrail.zip -d /var/www/
|
2020-05-19 22:36:10 +03:00
|
|
|
|
|
|
|
createOptDirectory $TR_DEFAULT_LOG_DIR
|
|
|
|
createOptDirectory $TR_DEFAULT_AUDIT_DIR
|
|
|
|
createOptDirectory $TR_DEFAULT_REPORT_DIR
|
|
|
|
createOptDirectory $TR_DEFAULT_ATTACHMENT_DIR
|
|
|
|
|
2020-05-20 16:57:04 +03:00
|
|
|
|
|
|
|
chown -R www-data:www-data /var/www/testrail/config
|
|
|
|
|
|
|
|
|
2020-05-19 22:36:10 +03:00
|
|
|
echo "##############"
|
|
|
|
echo "Waiting for background task file"
|
|
|
|
while [ ! -f /var/www/testrail/task.php ]
|
|
|
|
do
|
|
|
|
sleep 2
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Starting background task"
|
|
|
|
while /bin/true; do
|
|
|
|
php /var/www/testrail/task.php || true
|
|
|
|
sleep $TR_DEFAULT_TASK_EXECUTION
|
|
|
|
done &
|
|
|
|
echo "##############"
|
|
|
|
|
2020-07-30 17:52:12 +03:00
|
|
|
chown www-data:www-data /var/www -R
|
|
|
|
|
|
|
|
source /etc/apache2/envvars
|
|
|
|
tail -F /var/log/apache2/* &
|
|
|
|
exec apache2 -D FOREGROUND
|