Skip to content

Commit 73e8018

Browse files
authored
修复低版本PHP测试 (#25)
* 修复低版本PHP测试 * test * test * test * test * test
1 parent 8cd8001 commit 73e8018

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
container_name: "php"
2020
build:
2121
context: .
22-
dockerfile: ./php.dockerfile
22+
dockerfile: ${PHP_DOCKER_FILE}
2323
args:
2424
PHP_DOCKER_VERSION: ${PHP_DOCKER_VERSION}
2525
volumes:

.github/php-5.dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG PHP_DOCKER_VERSION
2+
FROM php:${PHP_DOCKER_VERSION}-cli
3+
4+
RUN sed -i s/httpredir.debian.org/archive.debian.org/g /etc/apt/sources.list
5+
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
6+
7+
RUN sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list
8+
9+
RUN sed -i '/stretch-updates/d' /etc/apt/sources.list
10+
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
11+
RUN sed -i '/jessie\/updates/d' /etc/apt/sources.list
12+
13+
RUN apt update --allow-unauthenticated
14+
15+
RUN apt install --allow-unauthenticated -y --force-yes unzip ca-certificates
16+
17+
RUN docker-php-ext-install pcntl > /dev/null
18+
19+
RUN curl -o /usr/bin/composer https://getcomposer.org/composer-1.phar && chmod +x /usr/bin/composer

.github/prepare-test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ __DIR__=$(cd `dirname $0`; pwd)
44

55
cd $__DIR__
66

7+
if [[ `expr $PHP_DOCKER_VERSION \< 7` -eq 0 ]]; then
8+
export PHP_DOCKER_FILE="php.dockerfile"
9+
else
10+
export PHP_DOCKER_FILE="php-5.dockerfile"
11+
fi
12+
713
containerName=$1
814

915
docker-compose up -d $containerName \

0 commit comments

Comments
 (0)