mirror of
https://github.com/EpicMorg/docker-scripts.git
synced 2024-12-24 13:45:32 +03:00
web fixes
This commit is contained in:
parent
ec2a1ea370
commit
69fe756965
7
Makefile
7
Makefile
@ -882,8 +882,6 @@ ecosystem-testrail-images:
|
||||
cd `pwd`/linux/ecosystem/testrail/7.5.3.1000/main && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.0.1089/main && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1029/main && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1030/main && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1033/main && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.4.7036/main && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.6.1019/main && pwd && make build && make deploy
|
||||
|
||||
@ -947,8 +945,6 @@ ecosystem-testrail-images:
|
||||
cd `pwd`/linux/ecosystem/testrail/7.5.3.1000/ad && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.0.1089/ad && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1029/ad && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1030/ad && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1033/ad && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.4.7036/ad && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.6.1019/ad && pwd && make build && make deploy
|
||||
|
||||
@ -1012,12 +1008,9 @@ ecosystem-testrail-images:
|
||||
cd `pwd`/linux/ecosystem/testrail/7.5.3.1000/ldap && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.0.1089/ldap && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1029/ldap && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1030/ldap && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.1.1033/ldap && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.4.7036/ldap && pwd && make build && make deploy
|
||||
cd `pwd`/linux/ecosystem/testrail/8.0.6.1019/ldap && pwd && make build && make deploy
|
||||
|
||||
|
||||
ecosystem-torrserver-images:
|
||||
cd `pwd`/linux/ecosystem/torrserver && pwd && make build && make deploy
|
||||
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail {{item}} with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}} with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION={{ item }}
|
||||
ENV TESTRAIL_VERSION={{ item }}
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}}"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail {{item}} with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}} with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION={{ item }}
|
||||
ENV TESTRAIL_VERSION={{ item }}
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}}"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail {{item}} with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}} with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION={{ item }}
|
||||
ENV TESTRAIL_VERSION={{ item }}
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion72.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}}"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion72.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail {{item}} with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}} with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION={{ item }}
|
||||
ENV TESTRAIL_VERSION={{ item }}
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion72.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}}"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion72.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion72.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail {{item}} with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}} with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php8.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION={{ item }}
|
||||
ENV TESTRAIL_VERSION={{ item }}
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion81.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion81.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion81.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}}"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion81.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion81.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion81.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -163,7 +163,7 @@ RUN apt-get update && \
|
||||
php7.2-opcache \
|
||||
php7.2-pcov \
|
||||
php7.2-pgsql \
|
||||
php7.2-phalcon4 \
|
||||
# php7.2-phalcon4 \
|
||||
php7.2-phpdbg \
|
||||
php7.2-pinba \
|
||||
# php7.2-pq \
|
||||
|
@ -163,7 +163,7 @@ RUN apt-get update && \
|
||||
php7.3-opcache \
|
||||
php7.3-pcov \
|
||||
php7.3-pgsql \
|
||||
php7.3-phalcon4 \
|
||||
# php7.3-phalcon4 \
|
||||
php7.3-phpdbg \
|
||||
php7.3-pinba \
|
||||
# php7.3-pq \
|
||||
@ -171,7 +171,7 @@ RUN apt-get update && \
|
||||
php7.3-protobuf \
|
||||
php7.3-ps \
|
||||
php7.3-pspell \
|
||||
php7.3-psr \
|
||||
# php7.3-psr \
|
||||
php7.3-radius \
|
||||
php7.3-raphf \
|
||||
php7.3-rdkafka \
|
||||
|
@ -179,7 +179,7 @@ RUN apt-get update && \
|
||||
php7.4-protobuf \
|
||||
php7.4-ps \
|
||||
php7.4-pspell \
|
||||
php7.4-psr \
|
||||
# php7.4-psr \
|
||||
php7.4-radius \
|
||||
php7.4-raphf \
|
||||
php7.4-rdkafka \
|
||||
|
@ -73,11 +73,11 @@ RUN apt-get update && \
|
||||
php8.0-phpdbg \
|
||||
php8.0-pinba \
|
||||
# php8.0-pq \
|
||||
php8.0-propro \
|
||||
# php8.0-propro \
|
||||
php8.0-protobuf \
|
||||
php8.0-ps \
|
||||
php8.0-pspell \
|
||||
php8.0-psr \
|
||||
# php8.0-psr \
|
||||
php8.0-raphf \
|
||||
php8.0-rdkafka \
|
||||
php8.0-readline \
|
||||
|
@ -69,15 +69,15 @@ RUN apt-get update && \
|
||||
php8.1-opcache \
|
||||
php8.1-pcov \
|
||||
php8.1-pgsql \
|
||||
php8.1-phalcon5 \
|
||||
# php8.1-phalcon5 \
|
||||
php8.1-phpdbg \
|
||||
php8.1-pinba \
|
||||
# php8.1-pq \
|
||||
php8.1-propro \
|
||||
# php8.1-propro \
|
||||
php8.1-protobuf \
|
||||
php8.1-ps \
|
||||
php8.1-pspell \
|
||||
php8.1-psr \
|
||||
# php8.1-psr \
|
||||
php8.1-raphf \
|
||||
php8.1-rdkafka \
|
||||
php8.1-readline \
|
||||
|
@ -69,11 +69,11 @@ RUN apt-get update && \
|
||||
php8.2-opcache \
|
||||
php8.2-pcov \
|
||||
php8.2-pgsql \
|
||||
php8.2-phalcon5 \
|
||||
# php8.2-phalcon5 \
|
||||
php8.2-phpdbg \
|
||||
php8.2-pinba \
|
||||
# php8.2-pq \
|
||||
php8.2-propro \
|
||||
# php8.2-propro \
|
||||
php8.2-protobuf \
|
||||
php8.2-ps \
|
||||
php8.2-pspell \
|
||||
|
@ -68,14 +68,14 @@ RUN apt-get update && \
|
||||
php8.3-opcache \
|
||||
php8.3-pcov \
|
||||
php8.3-pgsql \
|
||||
php8.3-phalcon5 \
|
||||
# php8.3-phalcon5 \
|
||||
php8.3-phpdbg \
|
||||
php8.3-pinba \
|
||||
# php8.3-pq \
|
||||
php8.3-protobuf \
|
||||
php8.3-ps \
|
||||
php8.3-pspell \
|
||||
php8.3-psr \
|
||||
# php8.3-psr \
|
||||
php8.3-raphf \
|
||||
php8.3-rdkafka \
|
||||
php8.3-readline \
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.4.1.3669 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.4.1.3669 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.4.1.3669
|
||||
ENV TESTRAIL_VERSION=5.4.1.3669
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.4.1.3669"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.5.0.3727 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.0.3727 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.5.0.3727
|
||||
ENV TESTRAIL_VERSION=5.5.0.3727
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.0.3727"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.5.0.3731 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.0.3731 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.5.0.3731
|
||||
ENV TESTRAIL_VERSION=5.5.0.3731
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.0.3731"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.5.0.3735 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.0.3735 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.5.0.3735
|
||||
ENV TESTRAIL_VERSION=5.5.0.3735
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.0.3735"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.5.1.3746 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.1.3746 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.5.1.3746
|
||||
ENV TESTRAIL_VERSION=5.5.1.3746
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.5.1.3746"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.6.0.3853 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3853 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.6.0.3853
|
||||
ENV TESTRAIL_VERSION=5.6.0.3853
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3853"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.6.0.3856 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3856 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.6.0.3856
|
||||
ENV TESTRAIL_VERSION=5.6.0.3856
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3856"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.6.0.3861 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3861 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.6.0.3861
|
||||
ENV TESTRAIL_VERSION=5.6.0.3861
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3861"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.6.0.3862 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3862 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.6.0.3862
|
||||
ENV TESTRAIL_VERSION=5.6.0.3862
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3862"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.6.0.3865 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3865 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.6.0.3865
|
||||
ENV TESTRAIL_VERSION=5.6.0.3865
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.6.0.3865"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.7.0.3938 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.0.3938 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.7.0.3938
|
||||
ENV TESTRAIL_VERSION=5.7.0.3938
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.0.3938"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.7.0.3942 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.0.3942 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.7.0.3942
|
||||
ENV TESTRAIL_VERSION=5.7.0.3942
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.0.3942"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.7.0.3951 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.0.3951 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.7.0.3951
|
||||
ENV TESTRAIL_VERSION=5.7.0.3951
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.0.3951"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.7.1.4026 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.1.4026 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.7.1.4026
|
||||
ENV TESTRAIL_VERSION=5.7.1.4026
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.1.4026"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 5.7.1.4028 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.1.4028 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=5.7.1.4028
|
||||
ENV TESTRAIL_VERSION=5.7.1.4028
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 5.7.1.4028"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 6.0.0.4140 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.0.0.4140 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=6.0.0.4140
|
||||
ENV TESTRAIL_VERSION=6.0.0.4140
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.0.0.4140"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 6.0.1.4163 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.0.1.4163 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=6.0.1.4163
|
||||
ENV TESTRAIL_VERSION=6.0.1.4163
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.0.1.4163"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -2,67 +2,79 @@
|
||||
|
||||
echo "[testrail] Welcome to Testrail 6.1.0.4367 with Active Directory plugin"
|
||||
|
||||
echo "[testrail] Starting Testrail service"
|
||||
|
||||
##################################################################################
|
||||
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail Active Directory auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.0.4367 with LDAP plugin"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
|
||||
echo "[testrail] Unzipping testrail LDAP auth plugin"
|
||||
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1
|
||||
##############################################################################
|
||||
|
||||
|
||||
ARG TESTRAIL_VERSION=6.1.0.4367
|
||||
ENV TESTRAIL_VERSION=6.1.0.4367
|
||||
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
|
||||
ENV TR_DEFAULT_TASK_EXECUTION=60
|
||||
@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
||||
ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip
|
||||
RUN echo "[testrail] Preparing folders" && \
|
||||
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
|
||||
mkdir -p ${TR_WWW_PATH} && \
|
||||
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
|
||||
echo "[testrail] Downloading and installing" && \
|
||||
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
|
||||
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip -d /var/www/ && \
|
||||
chown -R www-data:www-data ${TR_WWW_PATH} && \
|
||||
ls -las ${TR_WWW_PATH} && \
|
||||
chown -R www-data:www-data ${TR_OPT_PATH} && \
|
||||
|
@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.0.4367"
|
||||
echo "[testrail] Starting testrail service"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Function for creating directories with rights for www-data
|
||||
function createOptDirectory {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
echo "[testrail] Creating " $1
|
||||
mkdir -p $1
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "[testrail] Creating $1"
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data $1
|
||||
chown -R www-data:www-data "$1"
|
||||
}
|
||||
|
||||
/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
|
||||
createOptDirectory ${TR_DEFAULT_LOG_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
|
||||
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
|
||||
|
||||
chown -R www-data:www-data ${TR_CONFIG_DIR}
|
||||
chown -R www-data:www-data ${TR_CONFIGPATH}
|
||||
#################################################################################
|
||||
# Copy Apache Configuration
|
||||
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"
|
||||
|
||||
#################################################################################
|
||||
# Unpacking TestRail
|
||||
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" ]; then
|
||||
echo "[testrail] Unzipping testrail service"
|
||||
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion71.zip" -d /var/www/
|
||||
echo "[testrail] Testrail extracted"
|
||||
else
|
||||
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion71.zip not found in ${TESTRAIL_RELEASE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Creating the necessary directories
|
||||
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
|
||||
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"
|
||||
|
||||
chown -R www-data:www-data "${TR_CONFIG_DIR}"
|
||||
chown -R www-data:www-data "${TR_CONFIGPATH}"
|
||||
|
||||
#################################################################################
|
||||
# Waiting for task.php file to appear
|
||||
TASK_FILE="/var/www/testrail/task.php"
|
||||
echo "[testrail] Waiting for background task file"
|
||||
while [ ! -f /var/www/testrail/task.php ]
|
||||
do
|
||||
sleep 2
|
||||
while [ ! -f "$TASK_FILE" ]; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "[testrail] Starting background task"
|
||||
# Removing the memory limit for executing a PHP task
|
||||
while /bin/true; do
|
||||
php /var/www/testrail/task.php || true
|
||||
sleep ${TR_DEFAULT_TASK_EXECUTION}
|
||||
php -d memory_limit=-1 "$TASK_FILE" || true
|
||||
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
|
||||
done &
|
||||
echo "[testrail] Background task stoped"
|
||||
|
||||
echo "[testrail] Background task started"
|
||||
|
||||
#################################################################################
|
||||
|
||||
# Processing the FIX_WWW_DATA environment variable
|
||||
if [[ -z "${FIX_WWW_DATA}" ]]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
|
||||
chown www-data:www-data /var/www -R
|
||||
elif [ "${FIX_WWW_DATA}" == "false" ]; then
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
|
||||
elif [ "${FIX_WWW_DATA}" == "true" ]; then
|
||||
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
|
||||
chown www-data:www-data /var/www -R
|
||||
echo "[apache2] Done"
|
||||
else
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
|
||||
fi
|
||||
|
||||
#################################################################################
|
||||
# Starting Apache
|
||||
echo "[apache2] Starting up"
|
||||
|
||||
source /etc/apache2/envvars
|
||||
tail -F /var/log/apache2/* &
|
||||
exec apache2 -D FOREGROUND
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user