-
Notifications
You must be signed in to change notification settings - Fork 46
/
.gitlab-ci.yml
26 lines (23 loc) · 1.06 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
services:
- mongo:3.4
before_script:
- PHP_VERSION=$(php -r 'echo phpversion();')
- echo $PHP_VERSION
- if [[ ${PHP_VERSION:0:2} == "5." ]]; then no | pecl install -o mongo; fi
- if [[ ${PHP_VERSION:0:2} == "5." ]]; then echo "extension = mongo.so" >> /usr/local/etc/php/conf.d/docker-php-ext-mongo.ini; fi
- if [[ ${PHP_VERSION:0:2} == "5." ]]; then php -r "echo \MongoClient::VERSION . PHP_EOL;"; fi
- if [[ ${PHP_VERSION:0:2} == "5." ]]; then no | pecl install -o mongodb; fi
- if [[ ${PHP_VERSION:0:2} == "7." ]]; then echo "extension = mongodb.so" >> /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini; fi
- if [[ ${PHP_VERSION:0:2} == "7." ]]; then php -r 'echo MONGODB_VERSION . PHP_EOL;'; fi
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php --quiet
- composer.phar update --no-interaction
- if [[ ${PHP_VERSION:0:2} == "7." ]]; then composer require "alcaeus/mongo-php-adapter"; fi
test:5.6:
image: php:5.6
script:
- composer test
test:7.0:
image: php:7.0
script:
- composer test