From dab8469c8cc6df050942c4974dc25df70b9edf5c Mon Sep 17 00:00:00 2001 From: Tim Nolte Date: Tue, 16 Apr 2024 19:28:52 -0400 Subject: [PATCH] fix(Admin lsphp): Updates build to use PHP 8.2 sources for admin lsphp - Fixes #166 - Updates the version of PHP sources to use for the OLS admin dashboard lsphp builds. - Adds OLS admin control panel access testing to Docker image build testing. --- .github/workflows/test-builds.yml | 19 +++++++++++++++++++ template/Dockerfile | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 1febb10..a78219e 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -77,6 +77,7 @@ jobs: - name: Test Docker Image run: | IMAGE=openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + echo -e 'Testing PHP Info Site...' ID=$(docker run -d ${IMAGE}) sleep 5s docker exec -i ${ID} su -c 'mkdir -p /var/www/vhosts/localhost/html/ && echo " /var/www/vhosts/localhost/html/index.php && service lsws restart' @@ -88,9 +89,27 @@ jobs: echo -e '[\u2718] Test failed!' echo "http://localhost returned ${HTTP}" echo "https://localhost returned ${HTTPS}" + docker rmi ${IMAGE} &>/dev/null exit 1 else + echo -e '[\u2714] Tests passed!' + fi + echo -e 'Testing OLS Admin Control Panel...' + ID=$(docker run -d ${IMAGE}) + sleep 5s + HTTP=$(docker exec -i ${ID} su -c 'curl -s -o /dev/null -Ik -w "%{http_code}" "http://localhost:7080/login.php?timedout=1#view/confMgr.php?m=tp_docker&p=ext"') + HTTPS=$(docker exec -i ${ID} su -c 'curl -s -o /dev/null -Ik -w "%{http_code}" "https://localhost:7080/login.php?timedout=1#view/confMgr.php?m=tp_docker&p=ext"') + docker kill ${ID} &>/dev/null + docker rm ${ID} &>/dev/null + if [[ "${HTTP}" != "200" || "${HTTPS}" != "200" ]]; then + echo -e '[\u2718] Test failed!' + echo "http://localhost returned ${HTTP}" + echo "https://localhost returned ${HTTPS}" docker rmi ${IMAGE} &>/dev/null + exit 1 + else echo -e '[\u2714] Tests passed!' fi + echo -e 'Cleaning Up Test Image...' + docker rmi ${IMAGE} &>/dev/null diff --git a/template/Dockerfile b/template/Dockerfile index ea6e4ae..26e7fc4 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -32,9 +32,9 @@ ENV OLS_VERSION=${OLS_VERSION} ENV PHP_VERSION=${PHP_VERSION} ENV PHP_MAJOR_VERSION=${PHP_MAJOR_VERSION} ENV PHP_MINOR_VERSION=${PHP_MINOR_VERSION} -ENV OLS_ADMIN_PHP_VERSION=7.4.33 -ENV OLS_ADMIN_PHP_MAJOR_VERSION=7 -ENV OLS_ADMIN_PHP_MINOR_VERSION=4 +ENV OLS_ADMIN_PHP_VERSION=8.2.18 +ENV OLS_ADMIN_PHP_MAJOR_VERSION=8 +ENV OLS_ADMIN_PHP_MINOR_VERSION=2 ENV NODE_VERSION=${NODE_VERSION} COPY *.sh /build/