Skip to content

Changes in travis build #1553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 22, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ install:
- docker version
- sudo pip install docker-compose
- docker-compose version
- sed -i -e "s/php:cli/php:${TRAVIS_PHP_VERSION}-cli/g" Dockerfile
- cat Dockerfile
- docker-compose build
- docker-compose build --build-arg PHP_VERSION=${TRAVIS_PHP_VERSION}

script:
- docker-compose up --exit-code-from php
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM php:cli
ARG PHP_VERSION

FROM php:${PHP_VERSION}-cli

RUN pecl install xdebug

RUN apt-get update && \
apt-get install -y autoconf pkg-config libssl-dev git && \
pecl install mongodb git zlib1g-dev && docker-php-ext-enable mongodb && \
apt-get install -y autoconf pkg-config libssl-dev git zlib1g-dev

RUN pecl install mongodb && docker-php-ext-enable mongodb && \
docker-php-ext-install -j$(nproc) pdo pdo_mysql zip && docker-php-ext-enable xdebug

RUN curl -sS https://getcomposer.org/installer | php \
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '3'

services:

php:
container_name: php
build:
Expand All @@ -10,6 +9,8 @@ services:
volumes:
- .:/code
working_dir: /code
environment:
PHP_VERSION: ${PHP_VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a fixed value I guess, or at least provide a default value. Could you change this?

Great job on these changes btw!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i can set default value, but env variable PHP_VERSION set in travis script build

Copy link
Contributor Author

@Smolevich Smolevich Jun 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also in Docker file i popose operation installing composer to replace on this construction

FROM composer as composer-build #official docker image with composer (https://github.com/composer/docker/blob/master/1.6/Dockerfile)

COPY --from=composer-build /usr/bin/composer /usr/local/bin/composer

command: bash -c "composer install --prefer-source --no-interaction && php ./vendor/bin/phpunit"
depends_on:
- mysql
Expand Down