Skip to content

Commit 8f95621

Browse files
committed
feat: use pre-built Swoole/OpenSwoole versions
Instead of building Swoole each time we change the container, we can pre-build it once and pull it in, similar to how we consume the sqlsrv extension. I've created a project, [laminas-ci-swoole-builder](https://github.com/weierophinney/laminas-ci-swoole-builder) that builds both Swoole and OpenSwoole using containers mimicing the Laminas-CI setup. The artifacts are then packaged and uploaded to an S3 bucket, allowing us to pull them in here. This can eventually be managed directly by Laminas, but in the meantime, should speed up our container builds, and give us quicker turnaround on new Swoole and OpenSwoole versions. Signed-off-by: Matthew Weier O'Phinney <[email protected]>
1 parent 77968da commit 8f95621

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

mods-available/swoole.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

mods-install/install_swoole.sh

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,14 @@
22

33
set -e
44

5-
SWOOLE_VERSION=4.7.0
5+
SWOOLE_PACKAGE_URL=https://uploads.mwop.net/laminas-ci/swoole-4.8.2-openswoole-4.8.0.tgz
6+
SWOOLE_PACKAGE=$(basename "${SWOOLE_PACKAGE_URL}")
67

7-
# Get swoole package ONCE
8+
# Download the pre-built extensions
89
cd /tmp
9-
wget https://pecl.php.net/get/swoole-${SWOOLE_VERSION}.tgz
10-
tar xzf swoole-${SWOOLE_VERSION}.tgz
11-
12-
# We only need to support currently supported PHP versions
13-
for PHP_VERSION in 7.3 7.4 8.0;do
14-
cd /tmp/swoole-${SWOOLE_VERSION}
15-
if [ -f Makefile ];then
16-
make clean
17-
fi
18-
phpize${PHP_VERSION}
19-
./configure --enable-swoole --enable-sockets --with-php-config=php-config${PHP_VERSION}
20-
make
21-
make install
22-
23-
cp /mods-available/swoole.ini /etc/php/${PHP_VERSION}/mods-available/swoole.ini
24-
done
10+
wget "${SWOOLE_PACKAGE_URL}"
11+
cd /
12+
tar xzf "/tmp/${SWOOLE_PACKAGE}"
2513

2614
# Cleanup
27-
rm -rf /tmp/swoole-${SWOOLE_VERSION}
28-
rm /tmp/swoole-${SWOOLE_VERSION}.tgz
15+
rm -rf "/tmp/${SWOOLE_PACKAGE}"

0 commit comments

Comments
 (0)