Skip to content

Commit c87bbf3

Browse files
committed
Merge pull request mongodb#1553 from Smolevich/changes-in-travis-build
Changes in travis build
2 parents 3bd21fc + 46fbf46 commit c87bbf3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ install:
1212
- docker version
1313
- sudo pip install docker-compose
1414
- docker-compose version
15-
- sed -i -e "s/php:cli/php:${TRAVIS_PHP_VERSION}-cli/g" Dockerfile
1615
- cat Dockerfile
17-
- docker-compose build
16+
- docker-compose build --build-arg PHP_VERSION=${TRAVIS_PHP_VERSION}
1817

1918
script:
2019
- docker-compose up --exit-code-from php

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
FROM php:cli
1+
ARG PHP_VERSION
2+
3+
FROM php:${PHP_VERSION}-cli
24

35
RUN pecl install xdebug
46

57
RUN apt-get update && \
6-
apt-get install -y autoconf pkg-config libssl-dev git && \
7-
pecl install mongodb git zlib1g-dev && docker-php-ext-enable mongodb && \
8+
apt-get install -y autoconf pkg-config libssl-dev git zlib1g-dev
9+
10+
RUN pecl install mongodb && docker-php-ext-enable mongodb && \
811
docker-php-ext-install -j$(nproc) pdo pdo_mysql zip && docker-php-ext-enable xdebug
912

1013
RUN curl -sS https://getcomposer.org/installer | php \

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: '3'
22

33
services:
4-
54
php:
65
container_name: php
76
build:
@@ -10,6 +9,8 @@ services:
109
volumes:
1110
- .:/code
1211
working_dir: /code
12+
environment:
13+
PHP_VERSION: 7.1
1314
command: bash -c "composer install --prefer-source --no-interaction && php ./vendor/bin/phpunit"
1415
depends_on:
1516
- mysql

0 commit comments

Comments
 (0)