Skip to content

Commit

Permalink
travis-ci: verify CentOS / Fedora packages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Totktonada committed Mar 28, 2020
1 parent 9bc7fa5 commit 91cf4a7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,38 @@ jobs:
- php: 7.4
env: TARANTOOL_VERSION=2.4

# RPM packages
# ------------
# Note: CentOS 6 & 7 do not provide PHP 7.*.
# Note: Fedora < 25 do not provide PHP 7.*.
- env: OS=el DIST=8
- env: OS=fedora DIST=25
- env: OS=fedora DIST=26
- env: OS=fedora DIST=27
- env: OS=fedora DIST=28
- env: OS=fedora DIST=29
- env: OS=fedora DIST=30
- env: OS=fedora DIST=31

python:
- 2.7

script:
- ./test.sh
- |
if [ -n "${TARANTOOL_VERSION}" ]; then
./test.sh
elif [ -n "${OS}" ] && [ -n "${DIST}" ]; then
git clone --depth 1 https://github.com/packpack/packpack.git
./packpack/packpack
if [ "${OS}" = "el" ]; then
export OS=centos
fi
docker run \
--volume "$(realpath .):/tarantool-php" \
--workdir /tarantool-php \
--rm \
"${OS}:${DIST}" \
./test.pkg.sh
else
exit 1
fi
41 changes: 41 additions & 0 deletions test.pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

set -exu # Strict shell (w/o -o pipefail)

if type dnf; then
PM_SYNC='dnf makecache'
PM_INSTALL_NAME='dnf -qy install'
PM_INSTALL_FILE='dnf -qy install'
PKG_GLOB='php-tarantool-*.x86_64.rpm'
elif type yum; then
PM_SYNC='yum makecache'
PM_INSTALL_NAME='yum -qy install'
PM_INSTALL_FILE='yum -qy install'
PKG_GLOB='php-tarantool-*.x86_64.rpm'
elif type apt-get; then
PM_SYNC='apt-get update'
PM_INSTALL_NAME='apt-get -qy install'
PM_INSTALL_FILE='dpkg -i'
PKG_GLOB='php7.?-tarantool*_amd64.deb'
# Prevent packages like tzdata from asking configuration
# parameters interactively.
# See https://github.com/packpack/packpack/issues/7
export DEBIAN_FRONTEND=noninteractive
else
echo "No suitable package manager found"
exit 1
fi

# Update available packages list.
${PM_SYNC}

# Install php interpreter.
${PM_INSTALL_NAME} php

# Install php-tarantool package.
${PM_INSTALL_FILE} build/${PKG_GLOB}

# A kind of very minimaliztic test. Verify that Tarantool instance
# can be created. It means that we at least install the dynamic
# library and php configuration file into right places.
php -r "new Tarantool('127.0.0.1', 3301);"

0 comments on commit 91cf4a7

Please sign in to comment.