Skip to content

Commit ac21315

Browse files
committed
Clean up dockerfile.sh
1 parent f590e2d commit ac21315

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77

88
env:
99
- IMAGE='php:7.1-cli' TNT_CLIENT=pecl
10-
- IMAGE='php:7.1-cli'
10+
- IMAGE='php:7.1-cli' CHECK_CS=1
1111
- IMAGE='php:7.2-cli' PHPUNIT_OPTS='--coverage-clover=coverage.clover'
1212
- IMAGE='php:7.3-rc-cli'
1313

dockerfile.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,34 @@ if [[ -z "$TNT_CLIENT" ]] ; then
88
TNT_CLIENT='pure'
99
fi
1010

11-
RUN_CMDS=''
12-
RUN_POST_CMDS=''
13-
14-
if [[ $IMAGE == php* ]]; then
15-
RUN_CMDS="$RUN_CMDS && \\\\\n docker-php-ext-install zip"
16-
if [[ $TNT_CLIENT == pure ]]; then
17-
RUN_POST_CMDS="$RUN_POST_CMDS && \\\\\n composer require tarantool/client:@dev"
18-
else
19-
RUN_CMDS="$RUN_CMDS && \\\\\n git clone https://github.com/tarantool/tarantool-php.git /usr/src/php/ext/tarantool"
20-
if [[ $IMAGE == php:7* ]]; then RUN_CMDS="$RUN_CMDS && \\\\\n git --git-dir=/usr/src/php/ext/tarantool/.git --work-tree=/usr/src/php/ext/tarantool checkout php7-v2"; fi
21-
RUN_CMDS="$RUN_CMDS && \\\\\n echo tarantool >> /usr/src/php-available-exts && docker-php-ext-install tarantool"
22-
fi
11+
if [[ $TNT_CLIENT == pecl ]]; then
12+
RUN_CMDS="$RUN_CMDS && \\\\\n git clone https://github.com/tarantool/tarantool-php.git /usr/src/php/ext/tarantool"
13+
RUN_CMDS="$RUN_CMDS && \\\\\n git --git-dir=/usr/src/php/ext/tarantool/.git --work-tree=/usr/src/php/ext/tarantool checkout php7-v2"
14+
RUN_CMDS="$RUN_CMDS && \\\\\n echo tarantool >> /usr/src/php-available-exts && docker-php-ext-install tarantool"
15+
COMPOSER_REMOVE='tarantool/client'
2316
fi
2417

2518
if [[ $PHPUNIT_OPTS =~ (^|[[:space:]])--coverage-[[:alpha:]] ]]; then
2619
RUN_CMDS="$RUN_CMDS && \\\\\n pecl install xdebug && docker-php-ext-enable xdebug"
2720
fi
2821

22+
if [[ "1" != "$CHECK_CS" ]]; then
23+
COMPOSER_REMOVE="$COMPOSER_REMOVE friendsofphp/php-cs-fixer"
24+
fi
25+
2926
echo -e "
3027
FROM $IMAGE
3128
3229
RUN apt-get update && \\
33-
apt-get install -y git curl zlib1g-dev${RUN_CMDS} && \\
34-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer${RUN_POST_CMDS}
30+
apt-get install -y git curl libzip-dev && \\
31+
docker-php-ext-configure zip --with-libzip && \\
32+
docker-php-ext-install zip${RUN_CMDS}
33+
34+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
3535
3636
ENV PATH=~/.composer/vendor/bin:\$PATH
3737
ENV TARANTOOL_HOST=tarantool TARANTOOL_PORT=3301
3838
39-
CMD if [ ! -f composer.lock ]; then composer install; fi && vendor/bin/phpunit\${PHPUNIT_OPTS:+ }\$PHPUNIT_OPTS
39+
CMD if [ ! -f composer.lock ]; then ${COMPOSER_REMOVE:+composer remove --dev --no-update }$COMPOSER_REMOVE${COMPOSER_REMOVE:+ && }composer install; fi && \\
40+
vendor/bin/phpunit\${PHPUNIT_OPTS:+ }\$PHPUNIT_OPTS
4041
"

0 commit comments

Comments
 (0)