PHPLIB-519: Extract driver installation to separate script

parent ee0b4539
...@@ -31,7 +31,7 @@ jobs: ...@@ -31,7 +31,7 @@ jobs:
php: "7.1" php: "7.1"
before_install: [] before_install: []
before_script: before_script:
- pecl install -f mongodb-${DRIVER_VERSION} - .travis/install-extension.sh
- composer require --no-update doctrine/coding-standard=^6.0 - composer require --no-update doctrine/coding-standard=^6.0
- composer install --no-interaction --no-progress --no-suggest ${COMPOSER_OPTIONS} - composer install --no-interaction --no-progress --no-suggest ${COMPOSER_OPTIONS}
script: vendor/bin/phpcs script: vendor/bin/phpcs
...@@ -120,28 +120,11 @@ before_install: ...@@ -120,28 +120,11 @@ before_install:
- mongod --version - mongod --version
- mongo-orchestration --version - mongo-orchestration --version
- export MO_PATH=`python -c 'import mongo_orchestration; from os import path; print(path.dirname(mongo_orchestration.__file__));'` - export MO_PATH=`python -c 'import mongo_orchestration; from os import path; print(path.dirname(mongo_orchestration.__file__));'`
- |
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# tpecl is a helper to compile and cache php extensions
tpecl () {
local ext_name=$1
local ext_so=$2
local ext_dir=$(php -r "echo ini_get('extension_dir');")
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
if [[ -e $ext_cache/$ext_so ]]; then
echo extension = $ext_cache/$ext_so >> $INI
else
mkdir -p $ext_cache
echo yes | pecl install -f $ext_name &&
cp $ext_dir/$ext_so $ext_cache
fi
}
export -f tpecl
before_script: before_script:
- mongo-orchestration start - mongo-orchestration start
- .travis/setup_mo.sh - .travis/setup_mo.sh
- pecl install -f mongodb-${DRIVER_VERSION} - .travis/install-extension.sh
- php --ri mongodb - php --ri mongodb
- composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable ${COMPOSER_OPTIONS} - composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable ${COMPOSER_OPTIONS}
- ulimit -c - ulimit -c
......
#!/bin/sh
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# tpecl is a helper to compile and cache php extensions
tpecl () {
local ext_name=$1
local ext_so=$2
local ext_dir=$(php -r "echo ini_get('extension_dir');")
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
if [[ -e $ext_cache/$ext_so ]]; then
echo extension = $ext_cache/$ext_so >> $INI
else
mkdir -p $ext_cache
echo yes | pecl install -f $ext_name &&
cp $ext_dir/$ext_so $ext_cache
fi
}
if [ "x${DRIVER_VERSION}" != "x" ]; then
echo "Installing driver version ${DRIVER_VERSION} from PECL"
tpecl mongodb-${DRIVER_VERSION} mongodb.so
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment