Skip to content

Commit 91cf4a7

Browse files
committed
travis-ci: verify CentOS / Fedora packages
Verify `packpack` based builds for CentOS and Fedora distributions using Travis CI. Deployment is not enabled here: it is subject for further commits. The key point is that we'll build the extension for php version that is provided by an OS itself. Why don't build against PHP versions from widely used Remi's repository? There are two reasons: * It will introduce dependency on a third-party repository for our third-party repository, at least in context of php-tarantool RPM packages. I guess it would quite unobvious from a user perspective. * We don't control when PHP ABI version will be changed in Remi's repositories. Is there a politic about this? I don't aware of it. We can get non-working packages after an update of PHP version in Remi's repo. So the decision for now is to provide packages for a PHP version provided by a distribution itself (from its base repositories). I plan to contact Remi and consult how to handle everything in a way that would be convenient for a user. Maybe it would be good to provide sources, spec and build tools from our side and ask Remi to include the extension into his repositories. Part of #117
1 parent 9bc7fa5 commit 91cf4a7

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

.travis.yml

+31-1
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,38 @@ jobs:
9090
- php: 7.4
9191
env: TARANTOOL_VERSION=2.4
9292

93+
# RPM packages
94+
# ------------
95+
# Note: CentOS 6 & 7 do not provide PHP 7.*.
96+
# Note: Fedora < 25 do not provide PHP 7.*.
97+
- env: OS=el DIST=8
98+
- env: OS=fedora DIST=25
99+
- env: OS=fedora DIST=26
100+
- env: OS=fedora DIST=27
101+
- env: OS=fedora DIST=28
102+
- env: OS=fedora DIST=29
103+
- env: OS=fedora DIST=30
104+
- env: OS=fedora DIST=31
105+
93106
python:
94107
- 2.7
95108

96109
script:
97-
- ./test.sh
110+
- |
111+
if [ -n "${TARANTOOL_VERSION}" ]; then
112+
./test.sh
113+
elif [ -n "${OS}" ] && [ -n "${DIST}" ]; then
114+
git clone --depth 1 https://github.com/packpack/packpack.git
115+
./packpack/packpack
116+
if [ "${OS}" = "el" ]; then
117+
export OS=centos
118+
fi
119+
docker run \
120+
--volume "$(realpath .):/tarantool-php" \
121+
--workdir /tarantool-php \
122+
--rm \
123+
"${OS}:${DIST}" \
124+
./test.pkg.sh
125+
else
126+
exit 1
127+
fi

test.pkg.sh

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh
2+
3+
set -exu # Strict shell (w/o -o pipefail)
4+
5+
if type dnf; then
6+
PM_SYNC='dnf makecache'
7+
PM_INSTALL_NAME='dnf -qy install'
8+
PM_INSTALL_FILE='dnf -qy install'
9+
PKG_GLOB='php-tarantool-*.x86_64.rpm'
10+
elif type yum; then
11+
PM_SYNC='yum makecache'
12+
PM_INSTALL_NAME='yum -qy install'
13+
PM_INSTALL_FILE='yum -qy install'
14+
PKG_GLOB='php-tarantool-*.x86_64.rpm'
15+
elif type apt-get; then
16+
PM_SYNC='apt-get update'
17+
PM_INSTALL_NAME='apt-get -qy install'
18+
PM_INSTALL_FILE='dpkg -i'
19+
PKG_GLOB='php7.?-tarantool*_amd64.deb'
20+
# Prevent packages like tzdata from asking configuration
21+
# parameters interactively.
22+
# See https://github.com/packpack/packpack/issues/7
23+
export DEBIAN_FRONTEND=noninteractive
24+
else
25+
echo "No suitable package manager found"
26+
exit 1
27+
fi
28+
29+
# Update available packages list.
30+
${PM_SYNC}
31+
32+
# Install php interpreter.
33+
${PM_INSTALL_NAME} php
34+
35+
# Install php-tarantool package.
36+
${PM_INSTALL_FILE} build/${PKG_GLOB}
37+
38+
# A kind of very minimaliztic test. Verify that Tarantool instance
39+
# can be created. It means that we at least install the dynamic
40+
# library and php configuration file into right places.
41+
php -r "new Tarantool('127.0.0.1', 3301);"

0 commit comments

Comments
 (0)