Skip to content

Commit

Permalink
Drop HHVM support + sync docker conf with Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Parmentier committed Oct 3, 2017
1 parent b30754b commit 382bcf7
Show file tree
Hide file tree
Showing 19 changed files with 249 additions and 206 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.idea/
bin/tests-all
doc/
docker/
vendor/
.dockerignore
.editorconfig
Expand Down
7 changes: 4 additions & 3 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ SFTP_HOST=sftp
SFTP_PORT=22
SFTP_USER=gaufrette
SFTP_PASSWORD=gaufrette
SFTP_BASE_DIR=/home/gaufrette
SFTP_BASE_DIR=gaufrette

FTP_HOST=vsftpd
FTP_HOST=ftp
FTP_PORT=21
FTP_USER=gaufrette
FTP_PASSWORD=gaufrette
FTP_BASE_DIR=/gaufrette/
FTP_BASE_DIR=/gaufrette

AZURE_ACCOUNT=
AZURE_KEY=
Expand Down
27 changes: 10 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ cache:
directories:
- $HOME/.composer/cache/files

php:
- 5.6
- 7.0
- 7.1
- hhvm

services:
- mongodb
- docker
Expand All @@ -31,22 +25,21 @@ env:
FTP_BASE_DIR=/gaufrette/

matrix:
allow_failures:
- php: hhvm
fast_finish: true

before_script:
- if [[ ${TRAVIS_PHP_VERSION:0:1} != "hhvm" ]]; then
echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
phpenv config-rm xdebug.ini;
else
composer require mongofill/mongofill --ignore-platform-reqs;
fi
include:
- php: '5.6'
- php: '7.0'
- php: '7.1'

before_install:
- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- docker run -p ${SFTP_PORT}:22 -d atmoz/sftp:alpine ${SFTP_USER}:${SFTP_PASSWORD}:::${SFTP_BASE_DIR}
- docker run -d --name ftpd_server -p ${FTP_PORT}:21 -p 30000-30009:30000-30009 -e "PUBLICHOST=${FTP_HOST}" stilliard/pure-ftpd
- docker exec -it ftpd_server sh -c "(echo ${FTP_PASSWORD}; echo ${FTP_PASSWORD}) | pure-pw useradd ${FTP_USER} -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u ftpuser -d /home/ftpusers/${FTP_USER}"
- if [[ ${TRAVIS_PHP_VERSION} = 5.* ]]; then sudo apt-get -qq update && sudo apt-get install -y libssh2-1-dev; fi
- if [[ ${TRAVIS_PHP_VERSION} = 5.* ]]; then yes | pecl install ssh2 && composer require herzult/php-ssh --no-update --no-scripts; fi

install:
- composer update --prefer-dist --no-progress --no-suggest --ansi

script:
Expand Down
56 changes: 56 additions & 0 deletions Dockerfile-php56
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM php:5.6-alpine

ENV SRC_DIR /usr/src/gaufrette

RUN apk add --no-cache --virtual .persistent-deps \
git \
zlib

# PHP extensions
ENV MONGODB_VERSION="1.2.11" \
SSH2_VERSION="0.13"

RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
libssh2-dev \
zlib-dev \
&& docker-php-ext-install \
zip \
&& pecl install \
mongodb-${MONGODB_VERSION} \
ssh2-${SSH2_VERSION} \
&& docker-php-ext-enable --ini-name 05-opcache.ini opcache \
&& docker-php-ext-enable \
mongodb \
ssh2 \
&& apk del .build-deps

COPY docker/php.ini /usr/local/etc/php/php.ini

COPY docker/install-composer.sh /usr/local/bin/install-composer
RUN chmod +x /usr/local/bin/install-composer

RUN set -xe \
&& install-composer \
&& mv composer.phar /usr/local/bin/composer

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN composer global require "hirak/prestissimo" --prefer-dist --no-progress --no-suggest --optimize-autoloader --apcu-autoloader \
&& composer clear-cache

WORKDIR ${SRC_DIR}

COPY composer.json ./
RUN composer update --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest \
&& composer clear-cache

COPY spec spec/
COPY src src/
COPY tests tests/
COPY bin/tests bin/tests

RUN composer dump-autoload

CMD ["bin/tests"]
68 changes: 68 additions & 0 deletions Dockerfile-php70
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM php:7.0-alpine

ENV SRC_DIR /usr/src/gaufrette

RUN apk add --no-cache --virtual .persistent-deps \
git \
zlib

# PHP extensions
ENV MONGODB_VERSION="1.2.11" \
SSH2_VERSION="1.1.2"

RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
libssh2-dev \
zlib-dev \
&& docker-php-ext-install \
zip \
&& pecl install \
mongodb-${MONGODB_VERSION} \
ssh2-${SSH2_VERSION} \
&& docker-php-ext-enable --ini-name 05-opcache.ini opcache \
&& docker-php-ext-enable \
mongodb \
ssh2 \
&& apk del .build-deps

COPY php.ini /usr/local/etc/php/php.ini

COPY install-composer.sh /usr/local/bin/docker-gaufrette-install-composer
RUN chmod +x /usr/local/bin/docker-gaufrette-install-composer

RUN set -xe \
&& apk add --no-cache --virtual .fetch-deps \
openssl \
&& docker-gaufrette-install-composer \
&& mv composer.phar /usr/local/bin/composer \
&& apk del .fetch-deps

COPY docker/php.ini /usr/local/etc/php/php.ini

COPY docker/install-composer.sh /usr/local/bin/install-composer
RUN chmod +x /usr/local/bin/install-composer

RUN set -xe \
&& install-composer \
&& mv composer.phar /usr/local/bin/composer

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN composer global require "hirak/prestissimo" --prefer-dist --no-progress --no-suggest --optimize-autoloader --apcu-autoloader \
&& composer clear-cache

WORKDIR ${SRC_DIR}

COPY composer.json ./
RUN composer update --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest \
&& composer clear-cache

COPY spec spec/
COPY src src/
COPY tests tests/
COPY bin/tests bin/tests

RUN composer dump-autoload

CMD ["bin/tests"]
56 changes: 56 additions & 0 deletions Dockerfile-php71
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM php:7.1-alpine

ENV SRC_DIR /usr/src/gaufrette

RUN apk add --no-cache --virtual .persistent-deps \
git \
zlib

# PHP extensions
ENV MONGODB_VERSION="1.2.11" \
SSH2_VERSION="1.1.2"

RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
libssh2-dev \
zlib-dev \
&& docker-php-ext-install \
zip \
&& pecl install \
mongodb-${MONGODB_VERSION} \
ssh2-${SSH2_VERSION} \
&& docker-php-ext-enable --ini-name 05-opcache.ini opcache \
&& docker-php-ext-enable \
mongodb \
ssh2 \
&& apk del .build-deps

COPY docker/php.ini /usr/local/etc/php/php.ini

COPY docker/install-composer.sh /usr/local/bin/install-composer
RUN chmod +x /usr/local/bin/install-composer

RUN set -xe \
&& install-composer \
&& mv composer.phar /usr/local/bin/composer

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN composer global require "hirak/prestissimo" --prefer-dist --no-progress --no-suggest --optimize-autoloader --apcu-autoloader \
&& composer clear-cache

WORKDIR ${SRC_DIR}

COPY composer.json ./
RUN composer update --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest \
&& composer clear-cache

COPY spec spec/
COPY src src/
COPY tests tests/
COPY bin/tests bin/tests

RUN composer dump-autoload

CMD ["bin/tests"]
8 changes: 4 additions & 4 deletions bin/tests
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/sh

set -o nounset
set -o errexit
set -o xtrace

DIR=$(dirname ${BASH_SOURCE[0]})/..
DIR=$(dirname $0)/..

${DIR}/vendor/bin/phpspec run --format=pretty
${DIR}/vendor/bin/phpunit
${DIR}/vendor/bin/phpunit tests
${DIR}/vendor/bin/phpspec run --format=pretty --no-code-generation
3 changes: 1 addition & 2 deletions bin/tests-all
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
#!/bin/sh

set -o xtrace

docker-compose run --rm php56
docker-compose run --rm php70
docker-compose run --rm php71
docker-compose run --rm hhvm
9 changes: 1 addition & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"type": "library",
"description": "PHP5 library that provides a filesystem abstraction layer",
"keywords": ["file", "filesystem", "media", "abstraction"],
"minimum-stability": "dev",
"homepage": "http://knplabs.com",
"license": "MIT",
"authors": [
Expand All @@ -16,12 +15,6 @@
"homepage": "http://github.com/knplabs/Gaufrette/contributors"
}
],
"repositories": [
{
"type": "pear",
"url": "https://pear.php.net"
}
],
"require": {
"php": ">=5.6"
},
Expand All @@ -40,7 +33,7 @@
"phpunit/phpunit": "^5.6.8",
"mikey179/vfsStream": "~1.2.0",
"league/flysystem": "~1.0",
"mongodb/mongodb": "~1.1.4",
"mongodb/mongodb": "^1.1",
"microsoft/windowsazure": "~0.4",
"microsoft/azure-storage": "~0.15.0",
"akeneo/phpspec-skip-example-extension": "~1.2"
Expand Down
Loading

0 comments on commit 382bcf7

Please sign in to comment.