From 69fe756965b979a685ed98fde2573d864de44f9d Mon Sep 17 00:00:00 2001 From: STAM Date: Thu, 12 Dec 2024 18:18:54 +0300 Subject: [PATCH] web fixes --- Makefile | 7 -- .../php70/ad/docker-entrypoint.sh.j2 | 100 ++++++++++-------- .../php70/ldap/docker-entrypoint.sh.j2 | 84 ++++++++------- .../templates/php70/main/Dockerfile.j2 | 6 +- .../php70/main/docker-entrypoint.sh.j2 | 83 +++++++++------ .../php71/ad/docker-entrypoint.sh.j2 | 100 ++++++++++-------- .../php71/ldap/docker-entrypoint.sh.j2 | 84 ++++++++------- .../templates/php71/main/Dockerfile.j2 | 6 +- .../php71/main/docker-entrypoint.sh.j2 | 83 +++++++++------ .../php72/ad/docker-entrypoint.sh.j2 | 100 ++++++++++-------- .../php72/ldap/docker-entrypoint.sh.j2 | 84 ++++++++------- .../templates/php72/main/Dockerfile.j2 | 6 +- .../php72/main/docker-entrypoint.sh.j2 | 83 +++++++++------ .../php74/ad/docker-entrypoint.sh.j2 | 100 ++++++++++-------- .../php74/ldap/docker-entrypoint.sh.j2 | 84 ++++++++------- .../templates/php74/main/Dockerfile.j2 | 6 +- .../php74/main/docker-entrypoint.sh.j2 | 83 +++++++++------ .../php81/ad/docker-entrypoint.sh.j2 | 100 ++++++++++-------- .../php81/ldap/docker-entrypoint.sh.j2 | 84 ++++++++------- .../templates/php81/main/Dockerfile.j2 | 6 +- .../php81/main/docker-entrypoint.sh.j2 | 83 +++++++++------ .../debian/12-bookworm/php/php7.2/Dockerfile | 2 +- .../debian/12-bookworm/php/php7.3/Dockerfile | 4 +- .../debian/12-bookworm/php/php7.4/Dockerfile | 2 +- .../debian/12-bookworm/php/php8.0/Dockerfile | 4 +- .../debian/12-bookworm/php/php8.1/Dockerfile | 6 +- .../debian/12-bookworm/php/php8.2/Dockerfile | 4 +- .../debian/12-bookworm/php/php8.3/Dockerfile | 4 +- .../5.4.1.3669/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.4.1.3669/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.4.1.3669/main/Dockerfile | 6 +- .../5.4.1.3669/main/docker-entrypoint.sh | 83 +++++++++------ .../5.5.0.3727/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.5.0.3727/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.5.0.3727/main/Dockerfile | 6 +- .../5.5.0.3727/main/docker-entrypoint.sh | 83 +++++++++------ .../5.5.0.3731/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.5.0.3731/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.5.0.3731/main/Dockerfile | 6 +- .../5.5.0.3731/main/docker-entrypoint.sh | 83 +++++++++------ .../5.5.0.3735/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.5.0.3735/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.5.0.3735/main/Dockerfile | 6 +- .../5.5.0.3735/main/docker-entrypoint.sh | 83 +++++++++------ .../5.5.1.3746/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.5.1.3746/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.5.1.3746/main/Dockerfile | 6 +- .../5.5.1.3746/main/docker-entrypoint.sh | 83 +++++++++------ .../5.6.0.3853/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.6.0.3853/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.6.0.3853/main/Dockerfile | 6 +- .../5.6.0.3853/main/docker-entrypoint.sh | 83 +++++++++------ .../5.6.0.3856/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.6.0.3856/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.6.0.3856/main/Dockerfile | 6 +- .../5.6.0.3856/main/docker-entrypoint.sh | 83 +++++++++------ .../5.6.0.3861/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.6.0.3861/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.6.0.3861/main/Dockerfile | 6 +- .../5.6.0.3861/main/docker-entrypoint.sh | 83 +++++++++------ .../5.6.0.3862/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.6.0.3862/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.6.0.3862/main/Dockerfile | 6 +- .../5.6.0.3862/main/docker-entrypoint.sh | 83 +++++++++------ .../5.6.0.3865/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.6.0.3865/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.6.0.3865/main/Dockerfile | 6 +- .../5.6.0.3865/main/docker-entrypoint.sh | 83 +++++++++------ .../5.7.0.3938/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.7.0.3938/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.7.0.3938/main/Dockerfile | 6 +- .../5.7.0.3938/main/docker-entrypoint.sh | 83 +++++++++------ .../5.7.0.3942/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.7.0.3942/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.7.0.3942/main/Dockerfile | 6 +- .../5.7.0.3942/main/docker-entrypoint.sh | 83 +++++++++------ .../5.7.0.3951/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.7.0.3951/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.7.0.3951/main/Dockerfile | 6 +- .../5.7.0.3951/main/docker-entrypoint.sh | 83 +++++++++------ .../5.7.1.4026/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.7.1.4026/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.7.1.4026/main/Dockerfile | 6 +- .../5.7.1.4026/main/docker-entrypoint.sh | 83 +++++++++------ .../5.7.1.4028/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../5.7.1.4028/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/5.7.1.4028/main/Dockerfile | 6 +- .../5.7.1.4028/main/docker-entrypoint.sh | 83 +++++++++------ .../6.0.0.4140/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.0.0.4140/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.0.0.4140/main/Dockerfile | 6 +- .../6.0.0.4140/main/docker-entrypoint.sh | 83 +++++++++------ .../6.0.1.4163/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.0.1.4163/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.0.1.4163/main/Dockerfile | 6 +- .../6.0.1.4163/main/docker-entrypoint.sh | 83 +++++++++------ .../6.1.0.4367/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.1.0.4367/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.1.0.4367/main/Dockerfile | 6 +- .../6.1.0.4367/main/docker-entrypoint.sh | 83 +++++++++------ .../6.1.0.4369/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.1.0.4369/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.1.0.4369/main/Dockerfile | 6 +- .../6.1.0.4369/main/docker-entrypoint.sh | 83 +++++++++------ .../6.1.1.1020/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.1.1.1020/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.1.1.1020/main/Dockerfile | 6 +- .../6.1.1.1020/main/docker-entrypoint.sh | 83 +++++++++------ .../6.1.1.1021/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.1.1.1021/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.1.1.1021/main/Dockerfile | 6 +- .../6.1.1.1021/main/docker-entrypoint.sh | 83 +++++++++------ .../6.2.0.1085/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.2.0.1085/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.2.0.1085/main/Dockerfile | 6 +- .../6.2.0.1085/main/docker-entrypoint.sh | 83 +++++++++------ .../6.2.1.1003/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.2.1.1003/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.2.1.1003/main/Dockerfile | 6 +- .../6.2.1.1003/main/docker-entrypoint.sh | 83 +++++++++------ .../6.2.1.1005/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.2.1.1005/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.2.1.1005/main/Dockerfile | 6 +- .../6.2.1.1005/main/docker-entrypoint.sh | 83 +++++++++------ .../6.2.2.1107/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.2.2.1107/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.2.2.1107/main/Dockerfile | 6 +- .../6.2.2.1107/main/docker-entrypoint.sh | 83 +++++++++------ .../6.2.3.1114/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.2.3.1114/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.2.3.1114/main/Dockerfile | 6 +- .../6.2.3.1114/main/docker-entrypoint.sh | 83 +++++++++------ .../6.3.0.1120/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.3.0.1120/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.3.0.1120/main/Dockerfile | 6 +- .../6.3.0.1120/main/docker-entrypoint.sh | 83 +++++++++------ .../6.3.1.1004/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.3.1.1004/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.3.1.1004/main/Dockerfile | 6 +- .../6.3.1.1004/main/docker-entrypoint.sh | 83 +++++++++------ .../6.3.1.1006/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.3.1.1006/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.3.1.1006/main/Dockerfile | 6 +- .../6.3.1.1006/main/docker-entrypoint.sh | 83 +++++++++------ .../6.4.0.1284/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.4.0.1284/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.4.0.1284/main/Dockerfile | 6 +- .../6.4.0.1284/main/docker-entrypoint.sh | 83 +++++++++------ .../6.4.0.1293/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.4.0.1293/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.4.0.1293/main/Dockerfile | 6 +- .../6.4.0.1293/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.0.1298/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.0.1298/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.0.1298/main/Dockerfile | 6 +- .../6.5.0.1298/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.1.1002/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.1.1002/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.1.1002/main/Dockerfile | 6 +- .../6.5.1.1002/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.3.1001/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.3.1001/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.3.1001/main/Dockerfile | 6 +- .../6.5.3.1001/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.4.1002/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.4.1002/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.4.1002/main/Dockerfile | 6 +- .../6.5.4.1002/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.4.1007/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.4.1007/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.4.1007/main/Dockerfile | 6 +- .../6.5.4.1007/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.5.1009/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.5.1009/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.5.1009/main/Dockerfile | 6 +- .../6.5.5.1009/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.6.1014/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.6.1014/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.6.1014/main/Dockerfile | 6 +- .../6.5.6.1014/main/docker-entrypoint.sh | 83 +++++++++------ .../6.5.7.1000/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.5.7.1000/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.5.7.1000/main/Dockerfile | 6 +- .../6.5.7.1000/main/docker-entrypoint.sh | 83 +++++++++------ .../6.6.0.1156/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.6.0.1156/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.6.0.1156/main/Dockerfile | 6 +- .../6.6.0.1156/main/docker-entrypoint.sh | 83 +++++++++------ .../6.6.1.1166/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.6.1.1166/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.6.1.1166/main/Dockerfile | 6 +- .../6.6.1.1166/main/docker-entrypoint.sh | 83 +++++++++------ .../6.7.1.1020/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.7.1.1020/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.7.1.1020/main/Dockerfile | 6 +- .../6.7.1.1020/main/docker-entrypoint.sh | 83 +++++++++------ .../6.7.2.1037/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.7.2.1037/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.7.2.1037/main/Dockerfile | 6 +- .../6.7.2.1037/main/docker-entrypoint.sh | 83 +++++++++------ .../6.7.2.1043/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../6.7.2.1043/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/6.7.2.1043/main/Dockerfile | 6 +- .../6.7.2.1043/main/docker-entrypoint.sh | 83 +++++++++------ .../7.0.0.1057/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.0.0.1057/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.0.0.1057/main/Dockerfile | 6 +- .../7.0.0.1057/main/docker-entrypoint.sh | 83 +++++++++------ .../7.0.1.1002/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.0.1.1002/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.0.1.1002/main/Dockerfile | 6 +- .../7.0.1.1002/main/docker-entrypoint.sh | 83 +++++++++------ .../7.0.1.1013/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.0.1.1013/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.0.1.1013/main/Dockerfile | 6 +- .../7.0.1.1013/main/docker-entrypoint.sh | 83 +++++++++------ .../7.0.2.1014/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.0.2.1014/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.0.2.1014/main/Dockerfile | 6 +- .../7.0.2.1014/main/docker-entrypoint.sh | 83 +++++++++------ .../7.0.2.1015/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.0.2.1015/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.0.2.1015/main/Dockerfile | 6 +- .../7.0.2.1015/main/docker-entrypoint.sh | 83 +++++++++------ .../7.0.2.1016/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.0.2.1016/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.0.2.1016/main/Dockerfile | 6 +- .../7.0.2.1016/main/docker-entrypoint.sh | 83 +++++++++------ .../7.4.1.8079/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.4.1.8079/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.4.1.8079/main/Dockerfile | 6 +- .../7.4.1.8079/main/docker-entrypoint.sh | 83 +++++++++------ .../7.4.1.8091/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.4.1.8091/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.4.1.8091/main/Dockerfile | 6 +- .../7.4.1.8091/main/docker-entrypoint.sh | 83 +++++++++------ .../7.4.1.8092/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.4.1.8092/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.4.1.8092/main/Dockerfile | 6 +- .../7.4.1.8092/main/docker-entrypoint.sh | 83 +++++++++------ .../7.5.1.7010/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.5.1.7010/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.5.1.7010/main/Dockerfile | 6 +- .../7.5.1.7010/main/docker-entrypoint.sh | 83 +++++++++------ .../7.5.1.7012/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.5.1.7012/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.5.1.7012/main/Dockerfile | 6 +- .../7.5.1.7012/main/docker-entrypoint.sh | 83 +++++++++------ .../7.5.1.7013/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.5.1.7013/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.5.1.7013/main/Dockerfile | 6 +- .../7.5.1.7013/main/docker-entrypoint.sh | 83 +++++++++------ .../7.5.2.1002/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.5.2.1002/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.5.2.1002/main/Dockerfile | 6 +- .../7.5.2.1002/main/docker-entrypoint.sh | 83 +++++++++------ .../7.5.3.1000/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../7.5.3.1000/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/7.5.3.1000/main/Dockerfile | 6 +- .../7.5.3.1000/main/docker-entrypoint.sh | 83 +++++++++------ .../8.0.0.1089/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../8.0.0.1089/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/8.0.0.1089/main/Dockerfile | 6 +- .../8.0.0.1089/main/docker-entrypoint.sh | 83 +++++++++------ .../8.0.1.1029/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../8.0.1.1029/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/8.0.1.1029/main/Dockerfile | 6 +- .../8.0.1.1029/main/docker-entrypoint.sh | 83 +++++++++------ .../8.0.4.7036/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../8.0.4.7036/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/8.0.4.7036/main/Dockerfile | 6 +- .../8.0.4.7036/main/docker-entrypoint.sh | 83 +++++++++------ .../8.0.6.1019/ad/docker-entrypoint.sh | 100 ++++++++++-------- .../8.0.6.1019/ldap/docker-entrypoint.sh | 84 ++++++++------- .../testrail/8.0.6.1019/main/Dockerfile | 6 +- .../8.0.6.1019/main/docker-entrypoint.sh | 83 +++++++++------ 276 files changed, 10398 insertions(+), 7926 deletions(-) diff --git a/Makefile b/Makefile index 05a744827..7e736b032 100644 --- a/Makefile +++ b/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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php70/ad/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php70/ad/docker-entrypoint.sh.j2 index 037600aee..468b47f9e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php70/ad/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php70/ad/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php70/ldap/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php70/ldap/docker-entrypoint.sh.j2 index 081b17418..67f61067e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php70/ldap/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php70/ldap/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php70/main/Dockerfile.j2 b/bin/ansible/roles/gurock.testrail/templates/php70/main/Dockerfile.j2 index 4eaa30f92..579213244 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php70/main/Dockerfile.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php70/main/Dockerfile.j2 @@ -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} && \ diff --git a/bin/ansible/roles/gurock.testrail/templates/php70/main/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php70/main/docker-entrypoint.sh.j2 index 7003eaf0d..00a014460 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php70/main/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php70/main/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php71/ad/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php71/ad/docker-entrypoint.sh.j2 index 037600aee..468b47f9e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php71/ad/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php71/ad/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php71/ldap/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php71/ldap/docker-entrypoint.sh.j2 index 081b17418..67f61067e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php71/ldap/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php71/ldap/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php71/main/Dockerfile.j2 b/bin/ansible/roles/gurock.testrail/templates/php71/main/Dockerfile.j2 index cf79a8f2a..55a9517d9 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php71/main/Dockerfile.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php71/main/Dockerfile.j2 @@ -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} && \ diff --git a/bin/ansible/roles/gurock.testrail/templates/php71/main/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php71/main/docker-entrypoint.sh.j2 index 7003eaf0d..2be57baf8 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php71/main/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php71/main/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php72/ad/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php72/ad/docker-entrypoint.sh.j2 index 037600aee..468b47f9e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php72/ad/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php72/ad/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php72/ldap/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php72/ldap/docker-entrypoint.sh.j2 index 081b17418..67f61067e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php72/ldap/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php72/ldap/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php72/main/Dockerfile.j2 b/bin/ansible/roles/gurock.testrail/templates/php72/main/Dockerfile.j2 index d533c0b45..eeae4041f 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php72/main/Dockerfile.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php72/main/Dockerfile.j2 @@ -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} && \ diff --git a/bin/ansible/roles/gurock.testrail/templates/php72/main/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php72/main/docker-entrypoint.sh.j2 index 7003eaf0d..998f7d1f3 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php72/main/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php72/main/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php74/ad/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php74/ad/docker-entrypoint.sh.j2 index 037600aee..468b47f9e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php74/ad/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php74/ad/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php74/ldap/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php74/ldap/docker-entrypoint.sh.j2 index 081b17418..67f61067e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php74/ldap/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php74/ldap/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php74/main/Dockerfile.j2 b/bin/ansible/roles/gurock.testrail/templates/php74/main/Dockerfile.j2 index a0170a095..19524c7a5 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php74/main/Dockerfile.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php74/main/Dockerfile.j2 @@ -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} && \ diff --git a/bin/ansible/roles/gurock.testrail/templates/php74/main/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php74/main/docker-entrypoint.sh.j2 index 7003eaf0d..998f7d1f3 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php74/main/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php74/main/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php81/ad/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php81/ad/docker-entrypoint.sh.j2 index 037600aee..468b47f9e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php81/ad/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php81/ad/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php81/ldap/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php81/ldap/docker-entrypoint.sh.j2 index 081b17418..67f61067e 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php81/ldap/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php81/ldap/docker-entrypoint.sh.j2 @@ -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 diff --git a/bin/ansible/roles/gurock.testrail/templates/php81/main/Dockerfile.j2 b/bin/ansible/roles/gurock.testrail/templates/php81/main/Dockerfile.j2 index 5fa600358..5cd682edb 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php81/main/Dockerfile.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php81/main/Dockerfile.j2 @@ -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} && \ diff --git a/bin/ansible/roles/gurock.testrail/templates/php81/main/docker-entrypoint.sh.j2 b/bin/ansible/roles/gurock.testrail/templates/php81/main/docker-entrypoint.sh.j2 index 7003eaf0d..6928d93b1 100644 --- a/bin/ansible/roles/gurock.testrail/templates/php81/main/docker-entrypoint.sh.j2 +++ b/bin/ansible/roles/gurock.testrail/templates/php81/main/docker-entrypoint.sh.j2 @@ -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 diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.2/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.2/Dockerfile index 1ca179f8a..ced0f8539 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.2/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.2/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.3/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.3/Dockerfile index f34b10fe2..c7112fe75 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.3/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.3/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.4/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.4/Dockerfile index 27413149b..2b1ed0529 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.4/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php7.4/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.0/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.0/Dockerfile index 6571bd75f..04204ba67 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.0/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.0/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.1/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.1/Dockerfile index d32eeabc8..f78d8b9ea 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.1/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.1/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.2/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.2/Dockerfile index 4795f929a..fae9a7114 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.2/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.2/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.3/Dockerfile b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.3/Dockerfile index 4f7835d44..e720577f3 100644 --- a/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.3/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/12-bookworm/php/php8.3/Dockerfile @@ -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 \ diff --git a/linux/ecosystem/testrail/5.4.1.3669/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.4.1.3669/ad/docker-entrypoint.sh index b38b7712c..001d8abe9 100755 --- a/linux/ecosystem/testrail/5.4.1.3669/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.4.1.3669/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.4.1.3669/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.4.1.3669/ldap/docker-entrypoint.sh index 098d9fc0a..916010ba8 100755 --- a/linux/ecosystem/testrail/5.4.1.3669/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.4.1.3669/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.4.1.3669/main/Dockerfile b/linux/ecosystem/testrail/5.4.1.3669/main/Dockerfile index 6b20a96be..d704d2a61 100644 --- a/linux/ecosystem/testrail/5.4.1.3669/main/Dockerfile +++ b/linux/ecosystem/testrail/5.4.1.3669/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.4.1.3669/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.4.1.3669/main/docker-entrypoint.sh index 7ed7a6c71..fe8d6c58f 100755 --- a/linux/ecosystem/testrail/5.4.1.3669/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.4.1.3669/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3727/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3727/ad/docker-entrypoint.sh index 8e62fdb8e..71dbd1ac3 100755 --- a/linux/ecosystem/testrail/5.5.0.3727/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3727/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3727/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3727/ldap/docker-entrypoint.sh index e416cd623..f3e2a14c4 100755 --- a/linux/ecosystem/testrail/5.5.0.3727/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3727/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3727/main/Dockerfile b/linux/ecosystem/testrail/5.5.0.3727/main/Dockerfile index fcf6b2025..b43c4b959 100644 --- a/linux/ecosystem/testrail/5.5.0.3727/main/Dockerfile +++ b/linux/ecosystem/testrail/5.5.0.3727/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.5.0.3727/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3727/main/docker-entrypoint.sh index f197e15f7..6045b2779 100755 --- a/linux/ecosystem/testrail/5.5.0.3727/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3727/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3731/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3731/ad/docker-entrypoint.sh index 41e756a7e..6a884656a 100755 --- a/linux/ecosystem/testrail/5.5.0.3731/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3731/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3731/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3731/ldap/docker-entrypoint.sh index faf37511e..4933352bf 100755 --- a/linux/ecosystem/testrail/5.5.0.3731/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3731/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3731/main/Dockerfile b/linux/ecosystem/testrail/5.5.0.3731/main/Dockerfile index c11921407..838df7b76 100644 --- a/linux/ecosystem/testrail/5.5.0.3731/main/Dockerfile +++ b/linux/ecosystem/testrail/5.5.0.3731/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.5.0.3731/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3731/main/docker-entrypoint.sh index 4ff710020..096ab90b0 100755 --- a/linux/ecosystem/testrail/5.5.0.3731/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3731/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3735/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3735/ad/docker-entrypoint.sh index d0587d22d..b561e779f 100755 --- a/linux/ecosystem/testrail/5.5.0.3735/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3735/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3735/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3735/ldap/docker-entrypoint.sh index 87f21c00d..529baea6f 100755 --- a/linux/ecosystem/testrail/5.5.0.3735/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3735/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.0.3735/main/Dockerfile b/linux/ecosystem/testrail/5.5.0.3735/main/Dockerfile index eda3e99e2..96b0f0bce 100644 --- a/linux/ecosystem/testrail/5.5.0.3735/main/Dockerfile +++ b/linux/ecosystem/testrail/5.5.0.3735/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.5.0.3735/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.0.3735/main/docker-entrypoint.sh index dc3f6e176..9729a1347 100755 --- a/linux/ecosystem/testrail/5.5.0.3735/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.0.3735/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.1.3746/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.1.3746/ad/docker-entrypoint.sh index 91b503323..16915602e 100755 --- a/linux/ecosystem/testrail/5.5.1.3746/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.1.3746/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.1.3746/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.1.3746/ldap/docker-entrypoint.sh index 321d1eec7..d516c90d2 100755 --- a/linux/ecosystem/testrail/5.5.1.3746/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.1.3746/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.5.1.3746/main/Dockerfile b/linux/ecosystem/testrail/5.5.1.3746/main/Dockerfile index ba3017e55..164e31457 100644 --- a/linux/ecosystem/testrail/5.5.1.3746/main/Dockerfile +++ b/linux/ecosystem/testrail/5.5.1.3746/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.5.1.3746/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.5.1.3746/main/docker-entrypoint.sh index bc40dd813..86ef2a52c 100755 --- a/linux/ecosystem/testrail/5.5.1.3746/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.5.1.3746/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3853/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3853/ad/docker-entrypoint.sh index 044cc5abd..ce66b2b57 100755 --- a/linux/ecosystem/testrail/5.6.0.3853/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3853/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3853/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3853/ldap/docker-entrypoint.sh index 349d93c6f..9ded14212 100755 --- a/linux/ecosystem/testrail/5.6.0.3853/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3853/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3853/main/Dockerfile b/linux/ecosystem/testrail/5.6.0.3853/main/Dockerfile index 8bdb9854b..9a6acf9a6 100644 --- a/linux/ecosystem/testrail/5.6.0.3853/main/Dockerfile +++ b/linux/ecosystem/testrail/5.6.0.3853/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.6.0.3853/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3853/main/docker-entrypoint.sh index 3de96faa2..2efa9230f 100755 --- a/linux/ecosystem/testrail/5.6.0.3853/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3853/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3856/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3856/ad/docker-entrypoint.sh index 73ef2d7a8..ac9fcd53c 100755 --- a/linux/ecosystem/testrail/5.6.0.3856/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3856/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3856/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3856/ldap/docker-entrypoint.sh index a78d1ece7..09dacd1e3 100755 --- a/linux/ecosystem/testrail/5.6.0.3856/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3856/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3856/main/Dockerfile b/linux/ecosystem/testrail/5.6.0.3856/main/Dockerfile index 16e3058fa..0e6562e92 100644 --- a/linux/ecosystem/testrail/5.6.0.3856/main/Dockerfile +++ b/linux/ecosystem/testrail/5.6.0.3856/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.6.0.3856/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3856/main/docker-entrypoint.sh index f526c7e3a..cb719bfbf 100755 --- a/linux/ecosystem/testrail/5.6.0.3856/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3856/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3861/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3861/ad/docker-entrypoint.sh index 83e4d4fd4..bba0db9eb 100755 --- a/linux/ecosystem/testrail/5.6.0.3861/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3861/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3861/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3861/ldap/docker-entrypoint.sh index 1a879664b..863fbd841 100755 --- a/linux/ecosystem/testrail/5.6.0.3861/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3861/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3861/main/Dockerfile b/linux/ecosystem/testrail/5.6.0.3861/main/Dockerfile index 01f2f243d..7bc619d5f 100644 --- a/linux/ecosystem/testrail/5.6.0.3861/main/Dockerfile +++ b/linux/ecosystem/testrail/5.6.0.3861/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.6.0.3861/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3861/main/docker-entrypoint.sh index 84e7b1aaf..dfd3356f0 100755 --- a/linux/ecosystem/testrail/5.6.0.3861/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3861/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3862/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3862/ad/docker-entrypoint.sh index f88ca1fc2..43d096270 100755 --- a/linux/ecosystem/testrail/5.6.0.3862/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3862/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3862/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3862/ldap/docker-entrypoint.sh index 003d4caf9..76c5e3b18 100755 --- a/linux/ecosystem/testrail/5.6.0.3862/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3862/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3862/main/Dockerfile b/linux/ecosystem/testrail/5.6.0.3862/main/Dockerfile index 60f0c1485..2744d2558 100644 --- a/linux/ecosystem/testrail/5.6.0.3862/main/Dockerfile +++ b/linux/ecosystem/testrail/5.6.0.3862/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.6.0.3862/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3862/main/docker-entrypoint.sh index 13b61ba1a..d44b3cd90 100755 --- a/linux/ecosystem/testrail/5.6.0.3862/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3862/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3865/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3865/ad/docker-entrypoint.sh index a0b592905..1004c3423 100755 --- a/linux/ecosystem/testrail/5.6.0.3865/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3865/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3865/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3865/ldap/docker-entrypoint.sh index c6307dee9..2d2ee7508 100755 --- a/linux/ecosystem/testrail/5.6.0.3865/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3865/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.6.0.3865/main/Dockerfile b/linux/ecosystem/testrail/5.6.0.3865/main/Dockerfile index d7c5df9aa..a0f10d97f 100644 --- a/linux/ecosystem/testrail/5.6.0.3865/main/Dockerfile +++ b/linux/ecosystem/testrail/5.6.0.3865/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.6.0.3865/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.6.0.3865/main/docker-entrypoint.sh index dec34af66..7d0da3fed 100755 --- a/linux/ecosystem/testrail/5.6.0.3865/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.6.0.3865/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3938/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3938/ad/docker-entrypoint.sh index b251904db..9b606098c 100755 --- a/linux/ecosystem/testrail/5.7.0.3938/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3938/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3938/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3938/ldap/docker-entrypoint.sh index 2effff5bb..1b5c1015b 100755 --- a/linux/ecosystem/testrail/5.7.0.3938/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3938/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3938/main/Dockerfile b/linux/ecosystem/testrail/5.7.0.3938/main/Dockerfile index 136c715bd..31fa29972 100644 --- a/linux/ecosystem/testrail/5.7.0.3938/main/Dockerfile +++ b/linux/ecosystem/testrail/5.7.0.3938/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.7.0.3938/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3938/main/docker-entrypoint.sh index b023dc8cb..8093e6a37 100755 --- a/linux/ecosystem/testrail/5.7.0.3938/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3938/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3942/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3942/ad/docker-entrypoint.sh index 14c2272b9..1767fdeb2 100755 --- a/linux/ecosystem/testrail/5.7.0.3942/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3942/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3942/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3942/ldap/docker-entrypoint.sh index 11b60fc0b..d36f44d5b 100755 --- a/linux/ecosystem/testrail/5.7.0.3942/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3942/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3942/main/Dockerfile b/linux/ecosystem/testrail/5.7.0.3942/main/Dockerfile index 4d5f6ef1e..4a7053be7 100644 --- a/linux/ecosystem/testrail/5.7.0.3942/main/Dockerfile +++ b/linux/ecosystem/testrail/5.7.0.3942/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.7.0.3942/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3942/main/docker-entrypoint.sh index b3aa045f7..eb4616459 100755 --- a/linux/ecosystem/testrail/5.7.0.3942/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3942/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3951/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3951/ad/docker-entrypoint.sh index e172ca743..b67e55554 100755 --- a/linux/ecosystem/testrail/5.7.0.3951/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3951/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3951/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3951/ldap/docker-entrypoint.sh index 1163436e4..46b5c21ed 100755 --- a/linux/ecosystem/testrail/5.7.0.3951/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3951/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.0.3951/main/Dockerfile b/linux/ecosystem/testrail/5.7.0.3951/main/Dockerfile index 2e7cba2bf..2569218b7 100644 --- a/linux/ecosystem/testrail/5.7.0.3951/main/Dockerfile +++ b/linux/ecosystem/testrail/5.7.0.3951/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.7.0.3951/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.0.3951/main/docker-entrypoint.sh index 20d5f2060..f73eaf9a5 100755 --- a/linux/ecosystem/testrail/5.7.0.3951/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.0.3951/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.1.4026/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.1.4026/ad/docker-entrypoint.sh index 9db5982a5..7658ada55 100755 --- a/linux/ecosystem/testrail/5.7.1.4026/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.1.4026/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.1.4026/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.1.4026/ldap/docker-entrypoint.sh index c6ba12579..f59ded594 100755 --- a/linux/ecosystem/testrail/5.7.1.4026/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.1.4026/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.1.4026/main/Dockerfile b/linux/ecosystem/testrail/5.7.1.4026/main/Dockerfile index ea4381dd4..6626fedb8 100644 --- a/linux/ecosystem/testrail/5.7.1.4026/main/Dockerfile +++ b/linux/ecosystem/testrail/5.7.1.4026/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.7.1.4026/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.1.4026/main/docker-entrypoint.sh index ad6682f2c..20c1ce6c0 100755 --- a/linux/ecosystem/testrail/5.7.1.4026/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.1.4026/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.1.4028/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.1.4028/ad/docker-entrypoint.sh index a9f584eca..abec80109 100755 --- a/linux/ecosystem/testrail/5.7.1.4028/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.1.4028/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.1.4028/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.1.4028/ldap/docker-entrypoint.sh index 8b762a618..9ac68da7b 100755 --- a/linux/ecosystem/testrail/5.7.1.4028/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.1.4028/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/5.7.1.4028/main/Dockerfile b/linux/ecosystem/testrail/5.7.1.4028/main/Dockerfile index d5169e90e..ebf112be4 100644 --- a/linux/ecosystem/testrail/5.7.1.4028/main/Dockerfile +++ b/linux/ecosystem/testrail/5.7.1.4028/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/5.7.1.4028/main/docker-entrypoint.sh b/linux/ecosystem/testrail/5.7.1.4028/main/docker-entrypoint.sh index 8390243eb..373278fc0 100755 --- a/linux/ecosystem/testrail/5.7.1.4028/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/5.7.1.4028/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.0.0.4140/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.0.0.4140/ad/docker-entrypoint.sh index 0dbf9b546..4833cee66 100755 --- a/linux/ecosystem/testrail/6.0.0.4140/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.0.0.4140/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.0.0.4140/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.0.0.4140/ldap/docker-entrypoint.sh index 647e21f11..35b04c10b 100755 --- a/linux/ecosystem/testrail/6.0.0.4140/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.0.0.4140/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.0.0.4140/main/Dockerfile b/linux/ecosystem/testrail/6.0.0.4140/main/Dockerfile index c90a1c130..683a6adf9 100644 --- a/linux/ecosystem/testrail/6.0.0.4140/main/Dockerfile +++ b/linux/ecosystem/testrail/6.0.0.4140/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/6.0.0.4140/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.0.0.4140/main/docker-entrypoint.sh index b144b0575..9d4622f08 100755 --- a/linux/ecosystem/testrail/6.0.0.4140/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.0.0.4140/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.0.1.4163/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.0.1.4163/ad/docker-entrypoint.sh index e4e4a0397..788cfe3b1 100755 --- a/linux/ecosystem/testrail/6.0.1.4163/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.0.1.4163/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.0.1.4163/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.0.1.4163/ldap/docker-entrypoint.sh index 9db55195b..5b8926ba3 100755 --- a/linux/ecosystem/testrail/6.0.1.4163/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.0.1.4163/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.0.1.4163/main/Dockerfile b/linux/ecosystem/testrail/6.0.1.4163/main/Dockerfile index 3c2f6fde1..373ce68bf 100644 --- a/linux/ecosystem/testrail/6.0.1.4163/main/Dockerfile +++ b/linux/ecosystem/testrail/6.0.1.4163/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/6.0.1.4163/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.0.1.4163/main/docker-entrypoint.sh index bc33dd9f0..d49f5a02a 100755 --- a/linux/ecosystem/testrail/6.0.1.4163/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.0.1.4163/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.1.0.4367/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.0.4367/ad/docker-entrypoint.sh index 9852de02b..3510e4897 100755 --- a/linux/ecosystem/testrail/6.1.0.4367/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.0.4367/ad/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.1.0.4367/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.0.4367/ldap/docker-entrypoint.sh index a3c223d6a..2c2389ec8 100755 --- a/linux/ecosystem/testrail/6.1.0.4367/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.0.4367/ldap/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.1.0.4367/main/Dockerfile b/linux/ecosystem/testrail/6.1.0.4367/main/Dockerfile index 7827308c3..73e67b6b0 100644 --- a/linux/ecosystem/testrail/6.1.0.4367/main/Dockerfile +++ b/linux/ecosystem/testrail/6.1.0.4367/main/Dockerfile @@ -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} && \ diff --git a/linux/ecosystem/testrail/6.1.0.4367/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.0.4367/main/docker-entrypoint.sh index aad46b65d..3eee44cbf 100755 --- a/linux/ecosystem/testrail/6.1.0.4367/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.0.4367/main/docker-entrypoint.sh @@ -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 diff --git a/linux/ecosystem/testrail/6.1.0.4369/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.0.4369/ad/docker-entrypoint.sh index 2eb2affd9..4e350fa8c 100755 --- a/linux/ecosystem/testrail/6.1.0.4369/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.0.4369/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.1.0.4369 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 diff --git a/linux/ecosystem/testrail/6.1.0.4369/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.0.4369/ldap/docker-entrypoint.sh index 32a41216a..b9b71ab11 100755 --- a/linux/ecosystem/testrail/6.1.0.4369/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.0.4369/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.0.4369 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 diff --git a/linux/ecosystem/testrail/6.1.0.4369/main/Dockerfile b/linux/ecosystem/testrail/6.1.0.4369/main/Dockerfile index 095638645..8044b7706 100644 --- a/linux/ecosystem/testrail/6.1.0.4369/main/Dockerfile +++ b/linux/ecosystem/testrail/6.1.0.4369/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.1.0.4369 +ENV TESTRAIL_VERSION=6.1.0.4369 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} && \ diff --git a/linux/ecosystem/testrail/6.1.0.4369/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.0.4369/main/docker-entrypoint.sh index 9e6bdbf73..56d96deec 100755 --- a/linux/ecosystem/testrail/6.1.0.4369/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.0.4369/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.0.4369" 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 diff --git a/linux/ecosystem/testrail/6.1.1.1020/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.1.1020/ad/docker-entrypoint.sh index 5d3d60637..b9684391a 100755 --- a/linux/ecosystem/testrail/6.1.1.1020/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.1.1020/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.1.1.1020 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 diff --git a/linux/ecosystem/testrail/6.1.1.1020/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.1.1020/ldap/docker-entrypoint.sh index 66240bc05..5d0554b65 100755 --- a/linux/ecosystem/testrail/6.1.1.1020/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.1.1020/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.1.1020 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 diff --git a/linux/ecosystem/testrail/6.1.1.1020/main/Dockerfile b/linux/ecosystem/testrail/6.1.1.1020/main/Dockerfile index 0a9b3f8c5..4ad59be00 100644 --- a/linux/ecosystem/testrail/6.1.1.1020/main/Dockerfile +++ b/linux/ecosystem/testrail/6.1.1.1020/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.1.1.1020 +ENV TESTRAIL_VERSION=6.1.1.1020 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} && \ diff --git a/linux/ecosystem/testrail/6.1.1.1020/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.1.1020/main/docker-entrypoint.sh index fc2f13580..dddd8c87d 100755 --- a/linux/ecosystem/testrail/6.1.1.1020/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.1.1020/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.1.1020" 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 diff --git a/linux/ecosystem/testrail/6.1.1.1021/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.1.1021/ad/docker-entrypoint.sh index bd07f2a4e..e65d41c55 100755 --- a/linux/ecosystem/testrail/6.1.1.1021/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.1.1021/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.1.1.1021 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 diff --git a/linux/ecosystem/testrail/6.1.1.1021/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.1.1021/ldap/docker-entrypoint.sh index 9df056483..16c1b4a29 100755 --- a/linux/ecosystem/testrail/6.1.1.1021/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.1.1021/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.1.1021 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 diff --git a/linux/ecosystem/testrail/6.1.1.1021/main/Dockerfile b/linux/ecosystem/testrail/6.1.1.1021/main/Dockerfile index e8fa17c38..a8dbe8f9f 100644 --- a/linux/ecosystem/testrail/6.1.1.1021/main/Dockerfile +++ b/linux/ecosystem/testrail/6.1.1.1021/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.1.1.1021 +ENV TESTRAIL_VERSION=6.1.1.1021 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} && \ diff --git a/linux/ecosystem/testrail/6.1.1.1021/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.1.1.1021/main/docker-entrypoint.sh index f585697cd..4fbbb6011 100755 --- a/linux/ecosystem/testrail/6.1.1.1021/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.1.1.1021/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.1.1.1021" 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 diff --git a/linux/ecosystem/testrail/6.2.0.1085/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.0.1085/ad/docker-entrypoint.sh index 90118cf4e..9e181a646 100755 --- a/linux/ecosystem/testrail/6.2.0.1085/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.0.1085/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.2.0.1085 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 diff --git a/linux/ecosystem/testrail/6.2.0.1085/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.0.1085/ldap/docker-entrypoint.sh index d7871029e..73ab5ddff 100755 --- a/linux/ecosystem/testrail/6.2.0.1085/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.0.1085/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.0.1085 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 diff --git a/linux/ecosystem/testrail/6.2.0.1085/main/Dockerfile b/linux/ecosystem/testrail/6.2.0.1085/main/Dockerfile index 3347f519c..455b6896c 100644 --- a/linux/ecosystem/testrail/6.2.0.1085/main/Dockerfile +++ b/linux/ecosystem/testrail/6.2.0.1085/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.2.0.1085 +ENV TESTRAIL_VERSION=6.2.0.1085 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} && \ diff --git a/linux/ecosystem/testrail/6.2.0.1085/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.0.1085/main/docker-entrypoint.sh index 708441c0f..7a3b9b0c0 100755 --- a/linux/ecosystem/testrail/6.2.0.1085/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.0.1085/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.0.1085" 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 diff --git a/linux/ecosystem/testrail/6.2.1.1003/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.1.1003/ad/docker-entrypoint.sh index 836e114da..e52c5ad89 100755 --- a/linux/ecosystem/testrail/6.2.1.1003/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.1.1003/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.2.1.1003 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 diff --git a/linux/ecosystem/testrail/6.2.1.1003/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.1.1003/ldap/docker-entrypoint.sh index e9e6ac169..a825c5d53 100755 --- a/linux/ecosystem/testrail/6.2.1.1003/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.1.1003/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.1.1003 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 diff --git a/linux/ecosystem/testrail/6.2.1.1003/main/Dockerfile b/linux/ecosystem/testrail/6.2.1.1003/main/Dockerfile index 74cb0e6a6..7ca663a3e 100644 --- a/linux/ecosystem/testrail/6.2.1.1003/main/Dockerfile +++ b/linux/ecosystem/testrail/6.2.1.1003/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.2.1.1003 +ENV TESTRAIL_VERSION=6.2.1.1003 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} && \ diff --git a/linux/ecosystem/testrail/6.2.1.1003/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.1.1003/main/docker-entrypoint.sh index 0065ad2ad..e0f910d14 100755 --- a/linux/ecosystem/testrail/6.2.1.1003/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.1.1003/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.1.1003" 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 diff --git a/linux/ecosystem/testrail/6.2.1.1005/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.1.1005/ad/docker-entrypoint.sh index e465f12a3..051dae7d9 100755 --- a/linux/ecosystem/testrail/6.2.1.1005/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.1.1005/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.2.1.1005 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 diff --git a/linux/ecosystem/testrail/6.2.1.1005/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.1.1005/ldap/docker-entrypoint.sh index 6c7ccd7b6..7ddace9d0 100755 --- a/linux/ecosystem/testrail/6.2.1.1005/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.1.1005/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.1.1005 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 diff --git a/linux/ecosystem/testrail/6.2.1.1005/main/Dockerfile b/linux/ecosystem/testrail/6.2.1.1005/main/Dockerfile index 26dd69074..9c5ab39bf 100644 --- a/linux/ecosystem/testrail/6.2.1.1005/main/Dockerfile +++ b/linux/ecosystem/testrail/6.2.1.1005/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.2.1.1005 +ENV TESTRAIL_VERSION=6.2.1.1005 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} && \ diff --git a/linux/ecosystem/testrail/6.2.1.1005/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.1.1005/main/docker-entrypoint.sh index 2875fd10e..17856e7b7 100755 --- a/linux/ecosystem/testrail/6.2.1.1005/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.1.1005/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.1.1005" 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 diff --git a/linux/ecosystem/testrail/6.2.2.1107/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.2.1107/ad/docker-entrypoint.sh index a6ee9cae8..df0011f39 100755 --- a/linux/ecosystem/testrail/6.2.2.1107/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.2.1107/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.2.2.1107 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 diff --git a/linux/ecosystem/testrail/6.2.2.1107/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.2.1107/ldap/docker-entrypoint.sh index 9961a6b5b..25f18c93c 100755 --- a/linux/ecosystem/testrail/6.2.2.1107/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.2.1107/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.2.1107 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 diff --git a/linux/ecosystem/testrail/6.2.2.1107/main/Dockerfile b/linux/ecosystem/testrail/6.2.2.1107/main/Dockerfile index 581948a9a..e0e85b6f2 100644 --- a/linux/ecosystem/testrail/6.2.2.1107/main/Dockerfile +++ b/linux/ecosystem/testrail/6.2.2.1107/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.2.2.1107 +ENV TESTRAIL_VERSION=6.2.2.1107 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} && \ diff --git a/linux/ecosystem/testrail/6.2.2.1107/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.2.1107/main/docker-entrypoint.sh index fc74c2dc0..6cfae83dc 100755 --- a/linux/ecosystem/testrail/6.2.2.1107/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.2.1107/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.2.1107" 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 diff --git a/linux/ecosystem/testrail/6.2.3.1114/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.3.1114/ad/docker-entrypoint.sh index 564439ca5..af29b4a68 100755 --- a/linux/ecosystem/testrail/6.2.3.1114/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.3.1114/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.2.3.1114 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 diff --git a/linux/ecosystem/testrail/6.2.3.1114/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.3.1114/ldap/docker-entrypoint.sh index 061cf3f01..7960c3bc0 100755 --- a/linux/ecosystem/testrail/6.2.3.1114/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.3.1114/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.3.1114 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 diff --git a/linux/ecosystem/testrail/6.2.3.1114/main/Dockerfile b/linux/ecosystem/testrail/6.2.3.1114/main/Dockerfile index 4de361fc4..92b773c31 100644 --- a/linux/ecosystem/testrail/6.2.3.1114/main/Dockerfile +++ b/linux/ecosystem/testrail/6.2.3.1114/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.2.3.1114 +ENV TESTRAIL_VERSION=6.2.3.1114 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} && \ diff --git a/linux/ecosystem/testrail/6.2.3.1114/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.2.3.1114/main/docker-entrypoint.sh index fca9a1a67..57415772c 100755 --- a/linux/ecosystem/testrail/6.2.3.1114/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.2.3.1114/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.2.3.1114" 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 diff --git a/linux/ecosystem/testrail/6.3.0.1120/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.0.1120/ad/docker-entrypoint.sh index 4efa355b2..4c9bf4156 100755 --- a/linux/ecosystem/testrail/6.3.0.1120/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.0.1120/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.3.0.1120 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 diff --git a/linux/ecosystem/testrail/6.3.0.1120/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.0.1120/ldap/docker-entrypoint.sh index 7db22a65f..4436a2037 100755 --- a/linux/ecosystem/testrail/6.3.0.1120/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.0.1120/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.3.0.1120 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 diff --git a/linux/ecosystem/testrail/6.3.0.1120/main/Dockerfile b/linux/ecosystem/testrail/6.3.0.1120/main/Dockerfile index c5f637380..0b765acda 100644 --- a/linux/ecosystem/testrail/6.3.0.1120/main/Dockerfile +++ b/linux/ecosystem/testrail/6.3.0.1120/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.3.0.1120 +ENV TESTRAIL_VERSION=6.3.0.1120 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} && \ diff --git a/linux/ecosystem/testrail/6.3.0.1120/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.0.1120/main/docker-entrypoint.sh index ef208fc42..f291268e6 100755 --- a/linux/ecosystem/testrail/6.3.0.1120/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.0.1120/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.3.0.1120" 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 diff --git a/linux/ecosystem/testrail/6.3.1.1004/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.1.1004/ad/docker-entrypoint.sh index bf2b2fe37..9883245b1 100755 --- a/linux/ecosystem/testrail/6.3.1.1004/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.1.1004/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.3.1.1004 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 diff --git a/linux/ecosystem/testrail/6.3.1.1004/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.1.1004/ldap/docker-entrypoint.sh index d584f4a2f..3a72fb793 100755 --- a/linux/ecosystem/testrail/6.3.1.1004/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.1.1004/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.3.1.1004 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 diff --git a/linux/ecosystem/testrail/6.3.1.1004/main/Dockerfile b/linux/ecosystem/testrail/6.3.1.1004/main/Dockerfile index 779aba76a..0662d2a8b 100644 --- a/linux/ecosystem/testrail/6.3.1.1004/main/Dockerfile +++ b/linux/ecosystem/testrail/6.3.1.1004/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.3.1.1004 +ENV TESTRAIL_VERSION=6.3.1.1004 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} && \ diff --git a/linux/ecosystem/testrail/6.3.1.1004/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.1.1004/main/docker-entrypoint.sh index 2f241e1d8..8c39e31f3 100755 --- a/linux/ecosystem/testrail/6.3.1.1004/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.1.1004/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.3.1.1004" 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 diff --git a/linux/ecosystem/testrail/6.3.1.1006/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.1.1006/ad/docker-entrypoint.sh index d81abb8a3..e3b38e41f 100755 --- a/linux/ecosystem/testrail/6.3.1.1006/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.1.1006/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.3.1.1006 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 diff --git a/linux/ecosystem/testrail/6.3.1.1006/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.1.1006/ldap/docker-entrypoint.sh index 0e5d8d3dd..576028ac3 100755 --- a/linux/ecosystem/testrail/6.3.1.1006/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.1.1006/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.3.1.1006 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 diff --git a/linux/ecosystem/testrail/6.3.1.1006/main/Dockerfile b/linux/ecosystem/testrail/6.3.1.1006/main/Dockerfile index 738df9a50..98774f433 100644 --- a/linux/ecosystem/testrail/6.3.1.1006/main/Dockerfile +++ b/linux/ecosystem/testrail/6.3.1.1006/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.3.1.1006 +ENV TESTRAIL_VERSION=6.3.1.1006 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} && \ diff --git a/linux/ecosystem/testrail/6.3.1.1006/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.3.1.1006/main/docker-entrypoint.sh index ef8a1693f..bd429398f 100755 --- a/linux/ecosystem/testrail/6.3.1.1006/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.3.1.1006/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.3.1.1006" 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 diff --git a/linux/ecosystem/testrail/6.4.0.1284/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.4.0.1284/ad/docker-entrypoint.sh index da01aefcf..192c996ef 100755 --- a/linux/ecosystem/testrail/6.4.0.1284/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.4.0.1284/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.4.0.1284 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 diff --git a/linux/ecosystem/testrail/6.4.0.1284/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.4.0.1284/ldap/docker-entrypoint.sh index a8ac11b44..d69a1245e 100755 --- a/linux/ecosystem/testrail/6.4.0.1284/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.4.0.1284/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.4.0.1284 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 diff --git a/linux/ecosystem/testrail/6.4.0.1284/main/Dockerfile b/linux/ecosystem/testrail/6.4.0.1284/main/Dockerfile index 76c7a3b6e..58ef4499a 100644 --- a/linux/ecosystem/testrail/6.4.0.1284/main/Dockerfile +++ b/linux/ecosystem/testrail/6.4.0.1284/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.4.0.1284 +ENV TESTRAIL_VERSION=6.4.0.1284 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} && \ diff --git a/linux/ecosystem/testrail/6.4.0.1284/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.4.0.1284/main/docker-entrypoint.sh index d3992227a..f13530639 100755 --- a/linux/ecosystem/testrail/6.4.0.1284/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.4.0.1284/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.4.0.1284" 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 diff --git a/linux/ecosystem/testrail/6.4.0.1293/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.4.0.1293/ad/docker-entrypoint.sh index 6fa097cb9..ad49de7b4 100755 --- a/linux/ecosystem/testrail/6.4.0.1293/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.4.0.1293/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.4.0.1293 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 diff --git a/linux/ecosystem/testrail/6.4.0.1293/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.4.0.1293/ldap/docker-entrypoint.sh index 3b7e46670..9f6baf325 100755 --- a/linux/ecosystem/testrail/6.4.0.1293/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.4.0.1293/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.4.0.1293 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 diff --git a/linux/ecosystem/testrail/6.4.0.1293/main/Dockerfile b/linux/ecosystem/testrail/6.4.0.1293/main/Dockerfile index 865f36bb6..095bf67cc 100644 --- a/linux/ecosystem/testrail/6.4.0.1293/main/Dockerfile +++ b/linux/ecosystem/testrail/6.4.0.1293/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.1 ############################################################################## -ARG TESTRAIL_VERSION=6.4.0.1293 +ENV TESTRAIL_VERSION=6.4.0.1293 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} && \ diff --git a/linux/ecosystem/testrail/6.4.0.1293/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.4.0.1293/main/docker-entrypoint.sh index 70b606990..84114e393 100755 --- a/linux/ecosystem/testrail/6.4.0.1293/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.4.0.1293/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.4.0.1293" 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 diff --git a/linux/ecosystem/testrail/6.5.0.1298/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.0.1298/ad/docker-entrypoint.sh index ee98786f0..992ca9fce 100755 --- a/linux/ecosystem/testrail/6.5.0.1298/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.0.1298/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.0.1298 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 diff --git a/linux/ecosystem/testrail/6.5.0.1298/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.0.1298/ldap/docker-entrypoint.sh index 10a80b751..eb3d4e534 100755 --- a/linux/ecosystem/testrail/6.5.0.1298/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.0.1298/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.0.1298 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 diff --git a/linux/ecosystem/testrail/6.5.0.1298/main/Dockerfile b/linux/ecosystem/testrail/6.5.0.1298/main/Dockerfile index cb825f537..eb1a46867 100644 --- a/linux/ecosystem/testrail/6.5.0.1298/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.0.1298/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.0.1298 +ENV TESTRAIL_VERSION=6.5.0.1298 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} && \ diff --git a/linux/ecosystem/testrail/6.5.0.1298/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.0.1298/main/docker-entrypoint.sh index 79a026696..9a688706d 100755 --- a/linux/ecosystem/testrail/6.5.0.1298/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.0.1298/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.0.1298" 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 diff --git a/linux/ecosystem/testrail/6.5.1.1002/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.1.1002/ad/docker-entrypoint.sh index ba95027f4..6943a9eaf 100755 --- a/linux/ecosystem/testrail/6.5.1.1002/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.1.1002/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.1.1002 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 diff --git a/linux/ecosystem/testrail/6.5.1.1002/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.1.1002/ldap/docker-entrypoint.sh index 08b0ebdcd..40c6930f8 100755 --- a/linux/ecosystem/testrail/6.5.1.1002/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.1.1002/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.1.1002 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 diff --git a/linux/ecosystem/testrail/6.5.1.1002/main/Dockerfile b/linux/ecosystem/testrail/6.5.1.1002/main/Dockerfile index 7d1058c88..693c717a6 100644 --- a/linux/ecosystem/testrail/6.5.1.1002/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.1.1002/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.1.1002 +ENV TESTRAIL_VERSION=6.5.1.1002 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} && \ diff --git a/linux/ecosystem/testrail/6.5.1.1002/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.1.1002/main/docker-entrypoint.sh index a9da8173b..b4e8b0092 100755 --- a/linux/ecosystem/testrail/6.5.1.1002/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.1.1002/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.1.1002" 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 diff --git a/linux/ecosystem/testrail/6.5.3.1001/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.3.1001/ad/docker-entrypoint.sh index 48894e5d5..1062a8374 100755 --- a/linux/ecosystem/testrail/6.5.3.1001/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.3.1001/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.3.1001 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 diff --git a/linux/ecosystem/testrail/6.5.3.1001/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.3.1001/ldap/docker-entrypoint.sh index ff8609bf2..631603e89 100755 --- a/linux/ecosystem/testrail/6.5.3.1001/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.3.1001/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.3.1001 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 diff --git a/linux/ecosystem/testrail/6.5.3.1001/main/Dockerfile b/linux/ecosystem/testrail/6.5.3.1001/main/Dockerfile index 84f4aa7e8..b80cd52e3 100644 --- a/linux/ecosystem/testrail/6.5.3.1001/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.3.1001/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.3.1001 +ENV TESTRAIL_VERSION=6.5.3.1001 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} && \ diff --git a/linux/ecosystem/testrail/6.5.3.1001/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.3.1001/main/docker-entrypoint.sh index 1f7d3c9ed..e2007af89 100755 --- a/linux/ecosystem/testrail/6.5.3.1001/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.3.1001/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.3.1001" 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 diff --git a/linux/ecosystem/testrail/6.5.4.1002/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.4.1002/ad/docker-entrypoint.sh index bd159c612..2acb50a79 100755 --- a/linux/ecosystem/testrail/6.5.4.1002/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.4.1002/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.4.1002 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 diff --git a/linux/ecosystem/testrail/6.5.4.1002/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.4.1002/ldap/docker-entrypoint.sh index c2edf2017..663a5ac11 100755 --- a/linux/ecosystem/testrail/6.5.4.1002/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.4.1002/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.4.1002 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 diff --git a/linux/ecosystem/testrail/6.5.4.1002/main/Dockerfile b/linux/ecosystem/testrail/6.5.4.1002/main/Dockerfile index afa31fbd3..436312fa2 100644 --- a/linux/ecosystem/testrail/6.5.4.1002/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.4.1002/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.4.1002 +ENV TESTRAIL_VERSION=6.5.4.1002 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} && \ diff --git a/linux/ecosystem/testrail/6.5.4.1002/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.4.1002/main/docker-entrypoint.sh index b8e970b18..709deec1b 100755 --- a/linux/ecosystem/testrail/6.5.4.1002/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.4.1002/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.4.1002" 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 diff --git a/linux/ecosystem/testrail/6.5.4.1007/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.4.1007/ad/docker-entrypoint.sh index 208bc877d..cbf147ece 100755 --- a/linux/ecosystem/testrail/6.5.4.1007/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.4.1007/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.4.1007 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 diff --git a/linux/ecosystem/testrail/6.5.4.1007/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.4.1007/ldap/docker-entrypoint.sh index af408eecf..af946bf4f 100755 --- a/linux/ecosystem/testrail/6.5.4.1007/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.4.1007/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.4.1007 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 diff --git a/linux/ecosystem/testrail/6.5.4.1007/main/Dockerfile b/linux/ecosystem/testrail/6.5.4.1007/main/Dockerfile index 33fd0c45f..159569c78 100644 --- a/linux/ecosystem/testrail/6.5.4.1007/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.4.1007/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.4.1007 +ENV TESTRAIL_VERSION=6.5.4.1007 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} && \ diff --git a/linux/ecosystem/testrail/6.5.4.1007/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.4.1007/main/docker-entrypoint.sh index c3bb43bcd..991d159fb 100755 --- a/linux/ecosystem/testrail/6.5.4.1007/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.4.1007/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.4.1007" 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 diff --git a/linux/ecosystem/testrail/6.5.5.1009/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.5.1009/ad/docker-entrypoint.sh index 671fabcce..5e5678fd3 100755 --- a/linux/ecosystem/testrail/6.5.5.1009/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.5.1009/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.5.1009 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 diff --git a/linux/ecosystem/testrail/6.5.5.1009/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.5.1009/ldap/docker-entrypoint.sh index 12c7ff3f6..c2c79703b 100755 --- a/linux/ecosystem/testrail/6.5.5.1009/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.5.1009/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.5.1009 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 diff --git a/linux/ecosystem/testrail/6.5.5.1009/main/Dockerfile b/linux/ecosystem/testrail/6.5.5.1009/main/Dockerfile index a6aa8b5f8..0662cd228 100644 --- a/linux/ecosystem/testrail/6.5.5.1009/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.5.1009/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.5.1009 +ENV TESTRAIL_VERSION=6.5.5.1009 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} && \ diff --git a/linux/ecosystem/testrail/6.5.5.1009/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.5.1009/main/docker-entrypoint.sh index f6f0e4789..77e6eab8d 100755 --- a/linux/ecosystem/testrail/6.5.5.1009/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.5.1009/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.5.1009" 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 diff --git a/linux/ecosystem/testrail/6.5.6.1014/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.6.1014/ad/docker-entrypoint.sh index a33155ce0..d29a4c7b1 100755 --- a/linux/ecosystem/testrail/6.5.6.1014/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.6.1014/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.6.1014 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 diff --git a/linux/ecosystem/testrail/6.5.6.1014/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.6.1014/ldap/docker-entrypoint.sh index c270ee01a..ca4a7d154 100755 --- a/linux/ecosystem/testrail/6.5.6.1014/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.6.1014/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.6.1014 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 diff --git a/linux/ecosystem/testrail/6.5.6.1014/main/Dockerfile b/linux/ecosystem/testrail/6.5.6.1014/main/Dockerfile index 539db301f..650dd74d4 100644 --- a/linux/ecosystem/testrail/6.5.6.1014/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.6.1014/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.6.1014 +ENV TESTRAIL_VERSION=6.5.6.1014 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} && \ diff --git a/linux/ecosystem/testrail/6.5.6.1014/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.6.1014/main/docker-entrypoint.sh index 6e622ecfc..e3e50c358 100755 --- a/linux/ecosystem/testrail/6.5.6.1014/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.6.1014/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.6.1014" 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 diff --git a/linux/ecosystem/testrail/6.5.7.1000/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.7.1000/ad/docker-entrypoint.sh index c3ff1d48e..8ab533028 100755 --- a/linux/ecosystem/testrail/6.5.7.1000/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.7.1000/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.5.7.1000 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 diff --git a/linux/ecosystem/testrail/6.5.7.1000/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.7.1000/ldap/docker-entrypoint.sh index e8170d7a8..328925965 100755 --- a/linux/ecosystem/testrail/6.5.7.1000/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.7.1000/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.7.1000 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 diff --git a/linux/ecosystem/testrail/6.5.7.1000/main/Dockerfile b/linux/ecosystem/testrail/6.5.7.1000/main/Dockerfile index bdd488140..3051a230c 100644 --- a/linux/ecosystem/testrail/6.5.7.1000/main/Dockerfile +++ b/linux/ecosystem/testrail/6.5.7.1000/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.5.7.1000 +ENV TESTRAIL_VERSION=6.5.7.1000 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} && \ diff --git a/linux/ecosystem/testrail/6.5.7.1000/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.5.7.1000/main/docker-entrypoint.sh index 790ac6fa4..621341891 100755 --- a/linux/ecosystem/testrail/6.5.7.1000/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.5.7.1000/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.5.7.1000" 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 diff --git a/linux/ecosystem/testrail/6.6.0.1156/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.6.0.1156/ad/docker-entrypoint.sh index da4d6b156..231580bab 100755 --- a/linux/ecosystem/testrail/6.6.0.1156/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.6.0.1156/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.6.0.1156 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 diff --git a/linux/ecosystem/testrail/6.6.0.1156/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.6.0.1156/ldap/docker-entrypoint.sh index d62f5d22e..53ac243ce 100755 --- a/linux/ecosystem/testrail/6.6.0.1156/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.6.0.1156/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.6.0.1156 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 diff --git a/linux/ecosystem/testrail/6.6.0.1156/main/Dockerfile b/linux/ecosystem/testrail/6.6.0.1156/main/Dockerfile index bfc4b457b..b9b50d205 100644 --- a/linux/ecosystem/testrail/6.6.0.1156/main/Dockerfile +++ b/linux/ecosystem/testrail/6.6.0.1156/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.6.0.1156 +ENV TESTRAIL_VERSION=6.6.0.1156 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} && \ diff --git a/linux/ecosystem/testrail/6.6.0.1156/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.6.0.1156/main/docker-entrypoint.sh index b53f5e0ed..83451c330 100755 --- a/linux/ecosystem/testrail/6.6.0.1156/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.6.0.1156/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.6.0.1156" 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 diff --git a/linux/ecosystem/testrail/6.6.1.1166/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.6.1.1166/ad/docker-entrypoint.sh index 36860ec3c..f9df12c56 100755 --- a/linux/ecosystem/testrail/6.6.1.1166/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.6.1.1166/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.6.1.1166 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 diff --git a/linux/ecosystem/testrail/6.6.1.1166/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.6.1.1166/ldap/docker-entrypoint.sh index 991acdb38..b9e10efd6 100755 --- a/linux/ecosystem/testrail/6.6.1.1166/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.6.1.1166/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.6.1.1166 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 diff --git a/linux/ecosystem/testrail/6.6.1.1166/main/Dockerfile b/linux/ecosystem/testrail/6.6.1.1166/main/Dockerfile index c623241ae..e92549419 100644 --- a/linux/ecosystem/testrail/6.6.1.1166/main/Dockerfile +++ b/linux/ecosystem/testrail/6.6.1.1166/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.6.1.1166 +ENV TESTRAIL_VERSION=6.6.1.1166 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} && \ diff --git a/linux/ecosystem/testrail/6.6.1.1166/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.6.1.1166/main/docker-entrypoint.sh index b6fa1fd5e..7321d1b69 100755 --- a/linux/ecosystem/testrail/6.6.1.1166/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.6.1.1166/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.6.1.1166" 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 diff --git a/linux/ecosystem/testrail/6.7.1.1020/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.1.1020/ad/docker-entrypoint.sh index a9ace7a41..cf910fe2a 100755 --- a/linux/ecosystem/testrail/6.7.1.1020/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.1.1020/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.7.1.1020 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 diff --git a/linux/ecosystem/testrail/6.7.1.1020/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.1.1020/ldap/docker-entrypoint.sh index 5a7172a56..20ca5757f 100755 --- a/linux/ecosystem/testrail/6.7.1.1020/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.1.1020/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.7.1.1020 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 diff --git a/linux/ecosystem/testrail/6.7.1.1020/main/Dockerfile b/linux/ecosystem/testrail/6.7.1.1020/main/Dockerfile index 5e811a27f..1f0a0bb92 100644 --- a/linux/ecosystem/testrail/6.7.1.1020/main/Dockerfile +++ b/linux/ecosystem/testrail/6.7.1.1020/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.7.1.1020 +ENV TESTRAIL_VERSION=6.7.1.1020 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} && \ diff --git a/linux/ecosystem/testrail/6.7.1.1020/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.1.1020/main/docker-entrypoint.sh index 5a0689b31..688a14829 100755 --- a/linux/ecosystem/testrail/6.7.1.1020/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.1.1020/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.7.1.1020" 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 diff --git a/linux/ecosystem/testrail/6.7.2.1037/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.2.1037/ad/docker-entrypoint.sh index 705b865da..46dc823c1 100755 --- a/linux/ecosystem/testrail/6.7.2.1037/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.2.1037/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.7.2.1037 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 diff --git a/linux/ecosystem/testrail/6.7.2.1037/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.2.1037/ldap/docker-entrypoint.sh index 280484c16..f373b3de9 100755 --- a/linux/ecosystem/testrail/6.7.2.1037/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.2.1037/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.7.2.1037 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 diff --git a/linux/ecosystem/testrail/6.7.2.1037/main/Dockerfile b/linux/ecosystem/testrail/6.7.2.1037/main/Dockerfile index 1e2770f01..f6ecf33e0 100644 --- a/linux/ecosystem/testrail/6.7.2.1037/main/Dockerfile +++ b/linux/ecosystem/testrail/6.7.2.1037/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.7.2.1037 +ENV TESTRAIL_VERSION=6.7.2.1037 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} && \ diff --git a/linux/ecosystem/testrail/6.7.2.1037/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.2.1037/main/docker-entrypoint.sh index 9c0316faf..1fbb87ea4 100755 --- a/linux/ecosystem/testrail/6.7.2.1037/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.2.1037/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.7.2.1037" 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 diff --git a/linux/ecosystem/testrail/6.7.2.1043/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.2.1043/ad/docker-entrypoint.sh index c6267fc1e..55c9b11b7 100755 --- a/linux/ecosystem/testrail/6.7.2.1043/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.2.1043/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 6.7.2.1043 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 diff --git a/linux/ecosystem/testrail/6.7.2.1043/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.2.1043/ldap/docker-entrypoint.sh index 8c43b62a8..159e8f70f 100755 --- a/linux/ecosystem/testrail/6.7.2.1043/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.2.1043/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 6.7.2.1043 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 diff --git a/linux/ecosystem/testrail/6.7.2.1043/main/Dockerfile b/linux/ecosystem/testrail/6.7.2.1043/main/Dockerfile index 0a7a9b06f..9c1fe9487 100644 --- a/linux/ecosystem/testrail/6.7.2.1043/main/Dockerfile +++ b/linux/ecosystem/testrail/6.7.2.1043/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.2 ############################################################################## -ARG TESTRAIL_VERSION=6.7.2.1043 +ENV TESTRAIL_VERSION=6.7.2.1043 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} && \ diff --git a/linux/ecosystem/testrail/6.7.2.1043/main/docker-entrypoint.sh b/linux/ecosystem/testrail/6.7.2.1043/main/docker-entrypoint.sh index a4927574f..7d5e320f6 100755 --- a/linux/ecosystem/testrail/6.7.2.1043/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/6.7.2.1043/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 6.7.2.1043" 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 diff --git a/linux/ecosystem/testrail/7.0.0.1057/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.0.1057/ad/docker-entrypoint.sh index 803100872..f69644388 100755 --- a/linux/ecosystem/testrail/7.0.0.1057/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.0.1057/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.0.0.1057 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 diff --git a/linux/ecosystem/testrail/7.0.0.1057/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.0.1057/ldap/docker-entrypoint.sh index a33080ce1..ed2a2562b 100755 --- a/linux/ecosystem/testrail/7.0.0.1057/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.0.1057/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.0.1057 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 diff --git a/linux/ecosystem/testrail/7.0.0.1057/main/Dockerfile b/linux/ecosystem/testrail/7.0.0.1057/main/Dockerfile index 998df3956..826a431b6 100644 --- a/linux/ecosystem/testrail/7.0.0.1057/main/Dockerfile +++ b/linux/ecosystem/testrail/7.0.0.1057/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.0.0.1057 +ENV TESTRAIL_VERSION=7.0.0.1057 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} && \ diff --git a/linux/ecosystem/testrail/7.0.0.1057/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.0.1057/main/docker-entrypoint.sh index 06ec1d0a0..9b910abab 100755 --- a/linux/ecosystem/testrail/7.0.0.1057/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.0.1057/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.0.1057" 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 diff --git a/linux/ecosystem/testrail/7.0.1.1002/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.1.1002/ad/docker-entrypoint.sh index 4ae36a0a8..9a1c29874 100755 --- a/linux/ecosystem/testrail/7.0.1.1002/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.1.1002/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.0.1.1002 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 diff --git a/linux/ecosystem/testrail/7.0.1.1002/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.1.1002/ldap/docker-entrypoint.sh index 5903d5fe9..dbe8242d2 100755 --- a/linux/ecosystem/testrail/7.0.1.1002/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.1.1002/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.1.1002 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 diff --git a/linux/ecosystem/testrail/7.0.1.1002/main/Dockerfile b/linux/ecosystem/testrail/7.0.1.1002/main/Dockerfile index 12a6980a3..94e7bea04 100644 --- a/linux/ecosystem/testrail/7.0.1.1002/main/Dockerfile +++ b/linux/ecosystem/testrail/7.0.1.1002/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.0.1.1002 +ENV TESTRAIL_VERSION=7.0.1.1002 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} && \ diff --git a/linux/ecosystem/testrail/7.0.1.1002/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.1.1002/main/docker-entrypoint.sh index ed8e7153f..9783652d2 100755 --- a/linux/ecosystem/testrail/7.0.1.1002/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.1.1002/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.1.1002" 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 diff --git a/linux/ecosystem/testrail/7.0.1.1013/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.1.1013/ad/docker-entrypoint.sh index 812e05f6a..83c89926c 100755 --- a/linux/ecosystem/testrail/7.0.1.1013/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.1.1013/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.0.1.1013 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 diff --git a/linux/ecosystem/testrail/7.0.1.1013/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.1.1013/ldap/docker-entrypoint.sh index 1230e891a..bcf739811 100755 --- a/linux/ecosystem/testrail/7.0.1.1013/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.1.1013/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.1.1013 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 diff --git a/linux/ecosystem/testrail/7.0.1.1013/main/Dockerfile b/linux/ecosystem/testrail/7.0.1.1013/main/Dockerfile index c56f1b83a..59e7649c2 100644 --- a/linux/ecosystem/testrail/7.0.1.1013/main/Dockerfile +++ b/linux/ecosystem/testrail/7.0.1.1013/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.0.1.1013 +ENV TESTRAIL_VERSION=7.0.1.1013 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} && \ diff --git a/linux/ecosystem/testrail/7.0.1.1013/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.1.1013/main/docker-entrypoint.sh index cdab9e3d5..565e48e29 100755 --- a/linux/ecosystem/testrail/7.0.1.1013/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.1.1013/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.1.1013" 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 diff --git a/linux/ecosystem/testrail/7.0.2.1014/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1014/ad/docker-entrypoint.sh index 0b1497d94..89cc51ce1 100755 --- a/linux/ecosystem/testrail/7.0.2.1014/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1014/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.0.2.1014 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 diff --git a/linux/ecosystem/testrail/7.0.2.1014/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1014/ldap/docker-entrypoint.sh index e6659b208..4ea3cdc24 100755 --- a/linux/ecosystem/testrail/7.0.2.1014/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1014/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.2.1014 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 diff --git a/linux/ecosystem/testrail/7.0.2.1014/main/Dockerfile b/linux/ecosystem/testrail/7.0.2.1014/main/Dockerfile index 0eea15a6b..00351848d 100644 --- a/linux/ecosystem/testrail/7.0.2.1014/main/Dockerfile +++ b/linux/ecosystem/testrail/7.0.2.1014/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.0.2.1014 +ENV TESTRAIL_VERSION=7.0.2.1014 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} && \ diff --git a/linux/ecosystem/testrail/7.0.2.1014/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1014/main/docker-entrypoint.sh index 3c1b997ca..b78b2c323 100755 --- a/linux/ecosystem/testrail/7.0.2.1014/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1014/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.2.1014" 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 diff --git a/linux/ecosystem/testrail/7.0.2.1015/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1015/ad/docker-entrypoint.sh index dd95921b0..10426fe6f 100755 --- a/linux/ecosystem/testrail/7.0.2.1015/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1015/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.0.2.1015 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 diff --git a/linux/ecosystem/testrail/7.0.2.1015/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1015/ldap/docker-entrypoint.sh index 1b961f4c3..110d992b3 100755 --- a/linux/ecosystem/testrail/7.0.2.1015/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1015/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.2.1015 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 diff --git a/linux/ecosystem/testrail/7.0.2.1015/main/Dockerfile b/linux/ecosystem/testrail/7.0.2.1015/main/Dockerfile index 2c5491fb5..9a5d06cca 100644 --- a/linux/ecosystem/testrail/7.0.2.1015/main/Dockerfile +++ b/linux/ecosystem/testrail/7.0.2.1015/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.0.2.1015 +ENV TESTRAIL_VERSION=7.0.2.1015 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} && \ diff --git a/linux/ecosystem/testrail/7.0.2.1015/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1015/main/docker-entrypoint.sh index 4d40d1678..93e867a1f 100755 --- a/linux/ecosystem/testrail/7.0.2.1015/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1015/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.2.1015" 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 diff --git a/linux/ecosystem/testrail/7.0.2.1016/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1016/ad/docker-entrypoint.sh index 8f52583a3..2ef282dbb 100755 --- a/linux/ecosystem/testrail/7.0.2.1016/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1016/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.0.2.1016 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 diff --git a/linux/ecosystem/testrail/7.0.2.1016/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1016/ldap/docker-entrypoint.sh index 3b126f218..e5b6571c3 100755 --- a/linux/ecosystem/testrail/7.0.2.1016/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1016/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.2.1016 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 diff --git a/linux/ecosystem/testrail/7.0.2.1016/main/Dockerfile b/linux/ecosystem/testrail/7.0.2.1016/main/Dockerfile index f7b179a2a..5ec88d128 100644 --- a/linux/ecosystem/testrail/7.0.2.1016/main/Dockerfile +++ b/linux/ecosystem/testrail/7.0.2.1016/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.0.2.1016 +ENV TESTRAIL_VERSION=7.0.2.1016 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} && \ diff --git a/linux/ecosystem/testrail/7.0.2.1016/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.0.2.1016/main/docker-entrypoint.sh index 9ce3b9630..9cad6f01f 100755 --- a/linux/ecosystem/testrail/7.0.2.1016/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.0.2.1016/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.0.2.1016" 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 diff --git a/linux/ecosystem/testrail/7.4.1.8079/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8079/ad/docker-entrypoint.sh index 6a01a3156..f01f94ea1 100755 --- a/linux/ecosystem/testrail/7.4.1.8079/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8079/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.4.1.8079 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 diff --git a/linux/ecosystem/testrail/7.4.1.8079/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8079/ldap/docker-entrypoint.sh index 2f842165a..d61017e16 100755 --- a/linux/ecosystem/testrail/7.4.1.8079/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8079/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.4.1.8079 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 diff --git a/linux/ecosystem/testrail/7.4.1.8079/main/Dockerfile b/linux/ecosystem/testrail/7.4.1.8079/main/Dockerfile index 721404b1c..10c6c287d 100644 --- a/linux/ecosystem/testrail/7.4.1.8079/main/Dockerfile +++ b/linux/ecosystem/testrail/7.4.1.8079/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.4.1.8079 +ENV TESTRAIL_VERSION=7.4.1.8079 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} && \ diff --git a/linux/ecosystem/testrail/7.4.1.8079/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8079/main/docker-entrypoint.sh index 47c667d2b..e07a23ef3 100755 --- a/linux/ecosystem/testrail/7.4.1.8079/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8079/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.4.1.8079" 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 diff --git a/linux/ecosystem/testrail/7.4.1.8091/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8091/ad/docker-entrypoint.sh index f42050f16..aa0f291cc 100755 --- a/linux/ecosystem/testrail/7.4.1.8091/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8091/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.4.1.8091 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 diff --git a/linux/ecosystem/testrail/7.4.1.8091/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8091/ldap/docker-entrypoint.sh index 9a1989435..7d1596ead 100755 --- a/linux/ecosystem/testrail/7.4.1.8091/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8091/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.4.1.8091 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 diff --git a/linux/ecosystem/testrail/7.4.1.8091/main/Dockerfile b/linux/ecosystem/testrail/7.4.1.8091/main/Dockerfile index 0eb53d34e..b87ae3ce5 100644 --- a/linux/ecosystem/testrail/7.4.1.8091/main/Dockerfile +++ b/linux/ecosystem/testrail/7.4.1.8091/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.4.1.8091 +ENV TESTRAIL_VERSION=7.4.1.8091 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} && \ diff --git a/linux/ecosystem/testrail/7.4.1.8091/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8091/main/docker-entrypoint.sh index e657b00c3..ec7c9a87e 100755 --- a/linux/ecosystem/testrail/7.4.1.8091/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8091/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.4.1.8091" 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 diff --git a/linux/ecosystem/testrail/7.4.1.8092/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8092/ad/docker-entrypoint.sh index 83f2d3f40..775c6c695 100755 --- a/linux/ecosystem/testrail/7.4.1.8092/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8092/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.4.1.8092 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 diff --git a/linux/ecosystem/testrail/7.4.1.8092/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8092/ldap/docker-entrypoint.sh index 72555a6bb..07e8a988d 100755 --- a/linux/ecosystem/testrail/7.4.1.8092/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8092/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.4.1.8092 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 diff --git a/linux/ecosystem/testrail/7.4.1.8092/main/Dockerfile b/linux/ecosystem/testrail/7.4.1.8092/main/Dockerfile index 088612f68..1d8cb4cdb 100644 --- a/linux/ecosystem/testrail/7.4.1.8092/main/Dockerfile +++ b/linux/ecosystem/testrail/7.4.1.8092/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.4.1.8092 +ENV TESTRAIL_VERSION=7.4.1.8092 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} && \ diff --git a/linux/ecosystem/testrail/7.4.1.8092/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.4.1.8092/main/docker-entrypoint.sh index dc1c41ac4..64e66d8b9 100755 --- a/linux/ecosystem/testrail/7.4.1.8092/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.4.1.8092/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.4.1.8092" 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 diff --git a/linux/ecosystem/testrail/7.5.1.7010/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7010/ad/docker-entrypoint.sh index 448618e1c..7f64ffb20 100755 --- a/linux/ecosystem/testrail/7.5.1.7010/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7010/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.5.1.7010 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 diff --git a/linux/ecosystem/testrail/7.5.1.7010/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7010/ldap/docker-entrypoint.sh index d1b2de3fe..7257d2475 100755 --- a/linux/ecosystem/testrail/7.5.1.7010/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7010/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.1.7010 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 diff --git a/linux/ecosystem/testrail/7.5.1.7010/main/Dockerfile b/linux/ecosystem/testrail/7.5.1.7010/main/Dockerfile index 1d96a76d4..a01ea845a 100644 --- a/linux/ecosystem/testrail/7.5.1.7010/main/Dockerfile +++ b/linux/ecosystem/testrail/7.5.1.7010/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.5.1.7010 +ENV TESTRAIL_VERSION=7.5.1.7010 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} && \ diff --git a/linux/ecosystem/testrail/7.5.1.7010/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7010/main/docker-entrypoint.sh index b97ab9b98..8a4497e91 100755 --- a/linux/ecosystem/testrail/7.5.1.7010/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7010/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.1.7010" 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 diff --git a/linux/ecosystem/testrail/7.5.1.7012/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7012/ad/docker-entrypoint.sh index cd3b060ac..fffffc34a 100755 --- a/linux/ecosystem/testrail/7.5.1.7012/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7012/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.5.1.7012 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 diff --git a/linux/ecosystem/testrail/7.5.1.7012/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7012/ldap/docker-entrypoint.sh index f2ee54fb8..7d8ea8ba6 100755 --- a/linux/ecosystem/testrail/7.5.1.7012/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7012/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.1.7012 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 diff --git a/linux/ecosystem/testrail/7.5.1.7012/main/Dockerfile b/linux/ecosystem/testrail/7.5.1.7012/main/Dockerfile index 66289fb96..6707ead75 100644 --- a/linux/ecosystem/testrail/7.5.1.7012/main/Dockerfile +++ b/linux/ecosystem/testrail/7.5.1.7012/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.5.1.7012 +ENV TESTRAIL_VERSION=7.5.1.7012 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} && \ diff --git a/linux/ecosystem/testrail/7.5.1.7012/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7012/main/docker-entrypoint.sh index 49cb9e51f..55deea131 100755 --- a/linux/ecosystem/testrail/7.5.1.7012/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7012/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.1.7012" 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 diff --git a/linux/ecosystem/testrail/7.5.1.7013/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7013/ad/docker-entrypoint.sh index 533f1ebdb..06bb855e4 100755 --- a/linux/ecosystem/testrail/7.5.1.7013/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7013/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.5.1.7013 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 diff --git a/linux/ecosystem/testrail/7.5.1.7013/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7013/ldap/docker-entrypoint.sh index f1e429f02..db55bfad5 100755 --- a/linux/ecosystem/testrail/7.5.1.7013/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7013/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.1.7013 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 diff --git a/linux/ecosystem/testrail/7.5.1.7013/main/Dockerfile b/linux/ecosystem/testrail/7.5.1.7013/main/Dockerfile index 2db8e825b..d3d3c873d 100644 --- a/linux/ecosystem/testrail/7.5.1.7013/main/Dockerfile +++ b/linux/ecosystem/testrail/7.5.1.7013/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.5.1.7013 +ENV TESTRAIL_VERSION=7.5.1.7013 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} && \ diff --git a/linux/ecosystem/testrail/7.5.1.7013/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.1.7013/main/docker-entrypoint.sh index 0ca8c8e4e..21879407b 100755 --- a/linux/ecosystem/testrail/7.5.1.7013/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.1.7013/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.1.7013" 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 diff --git a/linux/ecosystem/testrail/7.5.2.1002/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.2.1002/ad/docker-entrypoint.sh index 6435ac8bc..acafcf9ab 100755 --- a/linux/ecosystem/testrail/7.5.2.1002/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.2.1002/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.5.2.1002 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 diff --git a/linux/ecosystem/testrail/7.5.2.1002/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.2.1002/ldap/docker-entrypoint.sh index 8936ed12b..9ebde1aec 100755 --- a/linux/ecosystem/testrail/7.5.2.1002/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.2.1002/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.2.1002 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 diff --git a/linux/ecosystem/testrail/7.5.2.1002/main/Dockerfile b/linux/ecosystem/testrail/7.5.2.1002/main/Dockerfile index 5dc95336b..3618866d6 100644 --- a/linux/ecosystem/testrail/7.5.2.1002/main/Dockerfile +++ b/linux/ecosystem/testrail/7.5.2.1002/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.5.2.1002 +ENV TESTRAIL_VERSION=7.5.2.1002 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} && \ diff --git a/linux/ecosystem/testrail/7.5.2.1002/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.2.1002/main/docker-entrypoint.sh index db2f2d5ff..22cda4f3d 100755 --- a/linux/ecosystem/testrail/7.5.2.1002/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.2.1002/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.2.1002" 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 diff --git a/linux/ecosystem/testrail/7.5.3.1000/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.3.1000/ad/docker-entrypoint.sh index 3517671e1..684a9e5c4 100755 --- a/linux/ecosystem/testrail/7.5.3.1000/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.3.1000/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 7.5.3.1000 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 diff --git a/linux/ecosystem/testrail/7.5.3.1000/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.3.1000/ldap/docker-entrypoint.sh index a03a1378c..1ddc0f1dd 100755 --- a/linux/ecosystem/testrail/7.5.3.1000/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.3.1000/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.3.1000 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 diff --git a/linux/ecosystem/testrail/7.5.3.1000/main/Dockerfile b/linux/ecosystem/testrail/7.5.3.1000/main/Dockerfile index 0b107f574..5d9415526 100644 --- a/linux/ecosystem/testrail/7.5.3.1000/main/Dockerfile +++ b/linux/ecosystem/testrail/7.5.3.1000/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.4 ############################################################################## -ARG TESTRAIL_VERSION=7.5.3.1000 +ENV TESTRAIL_VERSION=7.5.3.1000 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} && \ diff --git a/linux/ecosystem/testrail/7.5.3.1000/main/docker-entrypoint.sh b/linux/ecosystem/testrail/7.5.3.1000/main/docker-entrypoint.sh index 5d63991ec..d631f81b9 100755 --- a/linux/ecosystem/testrail/7.5.3.1000/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/7.5.3.1000/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 7.5.3.1000" 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 diff --git a/linux/ecosystem/testrail/8.0.0.1089/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.0.1089/ad/docker-entrypoint.sh index ff2445a92..9c7c17bc8 100755 --- a/linux/ecosystem/testrail/8.0.0.1089/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.0.1089/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 8.0.0.1089 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 diff --git a/linux/ecosystem/testrail/8.0.0.1089/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.0.1089/ldap/docker-entrypoint.sh index d2724006b..937a26c87 100755 --- a/linux/ecosystem/testrail/8.0.0.1089/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.0.1089/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.0.1089 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 diff --git a/linux/ecosystem/testrail/8.0.0.1089/main/Dockerfile b/linux/ecosystem/testrail/8.0.0.1089/main/Dockerfile index b08313104..11cfbd834 100644 --- a/linux/ecosystem/testrail/8.0.0.1089/main/Dockerfile +++ b/linux/ecosystem/testrail/8.0.0.1089/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php8.1 ############################################################################## -ARG TESTRAIL_VERSION=8.0.0.1089 +ENV TESTRAIL_VERSION=8.0.0.1089 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} && \ diff --git a/linux/ecosystem/testrail/8.0.0.1089/main/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.0.1089/main/docker-entrypoint.sh index 018e12233..ffd762387 100755 --- a/linux/ecosystem/testrail/8.0.0.1089/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.0.1089/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.0.1089" 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 diff --git a/linux/ecosystem/testrail/8.0.1.1029/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.1.1029/ad/docker-entrypoint.sh index 4404e044d..d174a1dcf 100755 --- a/linux/ecosystem/testrail/8.0.1.1029/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.1.1029/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 8.0.1.1029 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 diff --git a/linux/ecosystem/testrail/8.0.1.1029/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.1.1029/ldap/docker-entrypoint.sh index b3d10c88b..7c1959ddd 100755 --- a/linux/ecosystem/testrail/8.0.1.1029/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.1.1029/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.1.1029 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 diff --git a/linux/ecosystem/testrail/8.0.1.1029/main/Dockerfile b/linux/ecosystem/testrail/8.0.1.1029/main/Dockerfile index 6f5d053d0..2239bb021 100644 --- a/linux/ecosystem/testrail/8.0.1.1029/main/Dockerfile +++ b/linux/ecosystem/testrail/8.0.1.1029/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php8.1 ############################################################################## -ARG TESTRAIL_VERSION=8.0.1.1029 +ENV TESTRAIL_VERSION=8.0.1.1029 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} && \ diff --git a/linux/ecosystem/testrail/8.0.1.1029/main/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.1.1029/main/docker-entrypoint.sh index 50ac0fbf2..a94276266 100755 --- a/linux/ecosystem/testrail/8.0.1.1029/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.1.1029/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.1.1029" 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 diff --git a/linux/ecosystem/testrail/8.0.4.7036/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.4.7036/ad/docker-entrypoint.sh index e29df5d8a..f2ab13e58 100755 --- a/linux/ecosystem/testrail/8.0.4.7036/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.4.7036/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 8.0.4.7036 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 diff --git a/linux/ecosystem/testrail/8.0.4.7036/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.4.7036/ldap/docker-entrypoint.sh index 69b1a4241..e42471959 100755 --- a/linux/ecosystem/testrail/8.0.4.7036/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.4.7036/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.4.7036 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 diff --git a/linux/ecosystem/testrail/8.0.4.7036/main/Dockerfile b/linux/ecosystem/testrail/8.0.4.7036/main/Dockerfile index 5e43988b6..06d473429 100644 --- a/linux/ecosystem/testrail/8.0.4.7036/main/Dockerfile +++ b/linux/ecosystem/testrail/8.0.4.7036/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php8.1 ############################################################################## -ARG TESTRAIL_VERSION=8.0.4.7036 +ENV TESTRAIL_VERSION=8.0.4.7036 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} && \ diff --git a/linux/ecosystem/testrail/8.0.4.7036/main/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.4.7036/main/docker-entrypoint.sh index 5e3dd7898..915e6b2fd 100755 --- a/linux/ecosystem/testrail/8.0.4.7036/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.4.7036/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.4.7036" 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 diff --git a/linux/ecosystem/testrail/8.0.6.1019/ad/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.6.1019/ad/docker-entrypoint.sh index a8ea828f8..7babef286 100755 --- a/linux/ecosystem/testrail/8.0.6.1019/ad/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.6.1019/ad/docker-entrypoint.sh @@ -2,67 +2,79 @@ echo "[testrail] Welcome to Testrail 8.0.6.1019 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 diff --git a/linux/ecosystem/testrail/8.0.6.1019/ldap/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.6.1019/ldap/docker-entrypoint.sh index 3300fe63c..d382c0982 100755 --- a/linux/ecosystem/testrail/8.0.6.1019/ldap/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.6.1019/ldap/docker-entrypoint.sh @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.6.1019 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 diff --git a/linux/ecosystem/testrail/8.0.6.1019/main/Dockerfile b/linux/ecosystem/testrail/8.0.6.1019/main/Dockerfile index 9dd07f87a..bd9e32c21 100644 --- a/linux/ecosystem/testrail/8.0.6.1019/main/Dockerfile +++ b/linux/ecosystem/testrail/8.0.6.1019/main/Dockerfile @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php8.1 ############################################################################## -ARG TESTRAIL_VERSION=8.0.6.1019 +ENV TESTRAIL_VERSION=8.0.6.1019 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} && \ diff --git a/linux/ecosystem/testrail/8.0.6.1019/main/docker-entrypoint.sh b/linux/ecosystem/testrail/8.0.6.1019/main/docker-entrypoint.sh index 43540e6a6..f200845fb 100755 --- a/linux/ecosystem/testrail/8.0.6.1019/main/docker-entrypoint.sh +++ b/linux/ecosystem/testrail/8.0.6.1019/main/docker-entrypoint.sh @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail 8.0.6.1019" 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