Skip to content

Commit

Permalink
fix(Admin lsphp): Updates build to use PHP 8.2 sources for admin lsphp
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
timnolte committed Apr 17, 2024
1 parent 9b7fede commit dab8469
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<?php phpinfo();" > /var/www/vhosts/localhost/html/index.php && service lsws restart'
Expand All @@ -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
6 changes: 3 additions & 3 deletions template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit dab8469

Please sign in to comment.