Skip to content

Commit 7eead74

Browse files
committed
Merge pull request #706
2 parents ee0b453 + 672c34e commit 7eead74

File tree

2 files changed

+51
-19
lines changed

2 files changed

+51
-19
lines changed

.travis.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
php: "7.1"
3232
before_install: []
3333
before_script:
34-
- pecl install -f mongodb-${DRIVER_VERSION}
34+
- .travis/install-extension.sh
3535
- composer require --no-update doctrine/coding-standard=^6.0
3636
- composer install --no-interaction --no-progress --no-suggest ${COMPOSER_OPTIONS}
3737
script: vendor/bin/phpcs
@@ -112,6 +112,18 @@ jobs:
112112
env:
113113
- DEPLOYMENT=SHARDED_CLUSTER_RS
114114

115+
# Test next patch release for driver
116+
- stage: Test
117+
php: "7.3"
118+
env:
119+
- DRIVER_BRANCH="v1.6"
120+
121+
# Test next minor release for driver
122+
- stage: Test
123+
php: "7.3"
124+
env:
125+
- DRIVER_BRANCH="master"
126+
115127
before_install:
116128
- pip install "mongo-orchestration>=0.6.7,<1.0" --user `whoami`
117129
- export SERVER_FILENAME=mongodb-linux-x86_64-${SERVER_DISTRO}-${SERVER_VERSION}
@@ -120,28 +132,11 @@ before_install:
120132
- mongod --version
121133
- mongo-orchestration --version
122134
- export MO_PATH=`python -c 'import mongo_orchestration; from os import path; print(path.dirname(mongo_orchestration.__file__));'`
123-
- |
124-
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
125-
# tpecl is a helper to compile and cache php extensions
126-
tpecl () {
127-
local ext_name=$1
128-
local ext_so=$2
129-
local ext_dir=$(php -r "echo ini_get('extension_dir');")
130-
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
131-
if [[ -e $ext_cache/$ext_so ]]; then
132-
echo extension = $ext_cache/$ext_so >> $INI
133-
else
134-
mkdir -p $ext_cache
135-
echo yes | pecl install -f $ext_name &&
136-
cp $ext_dir/$ext_so $ext_cache
137-
fi
138-
}
139-
export -f tpecl
140135

141136
before_script:
142137
- mongo-orchestration start
143138
- .travis/setup_mo.sh
144-
- pecl install -f mongodb-${DRIVER_VERSION}
139+
- .travis/install-extension.sh
145140
- php --ri mongodb
146141
- composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable ${COMPOSER_OPTIONS}
147142
- ulimit -c

.travis/install-extension.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
3+
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
4+
# tpecl is a helper to compile and cache php extensions
5+
tpecl () {
6+
local ext_name=$1
7+
local ext_so=$2
8+
local ext_dir=$(php -r "echo ini_get('extension_dir');")
9+
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
10+
if [[ -e $ext_cache/$ext_so ]]; then
11+
echo extension = $ext_cache/$ext_so >> $INI
12+
else
13+
mkdir -p $ext_cache
14+
echo yes | pecl install -f $ext_name &&
15+
cp $ext_dir/$ext_so $ext_cache
16+
fi
17+
}
18+
19+
if [ "x${DRIVER_BRANCH}" != "x" ]; then
20+
echo "Compiling driver branch ${DRIVER_BRANCH}"
21+
22+
mkdir -p /tmp/compile
23+
git clone https://github.com/mongodb/mongo-php-driver /tmp/compile/mongo-php-driver
24+
cd /tmp/compile/mongo-php-driver
25+
26+
git checkout ${DRIVER_BRANCH}
27+
git submodule update --init
28+
phpize
29+
./configure --enable-mongodb-developer-flags
30+
make all -j20 > /dev/null
31+
make install
32+
33+
echo "extension=mongodb.so" >> `php --ini | grep "Scan for additional .ini files in" | sed -e "s|.*:\s*||"`/mongodb.ini
34+
elif [ "x${DRIVER_VERSION}" != "x" ]; then
35+
echo "Installing driver version ${DRIVER_VERSION} from PECL"
36+
tpecl mongodb-${DRIVER_VERSION} mongodb.so
37+
fi

0 commit comments

Comments
 (0)