Skip to content

Commit

Permalink
修复低版本PHP测试 (#25)
Browse files Browse the repository at this point in the history
* 修复低版本PHP测试

* test

* test

* test

* test

* test
  • Loading branch information
Yurunsoft authored May 18, 2023
1 parent 8cd8001 commit 73e8018
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
container_name: "php"
build:
context: .
dockerfile: ./php.dockerfile
dockerfile: ${PHP_DOCKER_FILE}
args:
PHP_DOCKER_VERSION: ${PHP_DOCKER_VERSION}
volumes:
Expand Down
19 changes: 19 additions & 0 deletions .github/php-5.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG PHP_DOCKER_VERSION
FROM php:${PHP_DOCKER_VERSION}-cli

RUN sed -i s/httpredir.debian.org/archive.debian.org/g /etc/apt/sources.list
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list

RUN sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list

RUN sed -i '/stretch-updates/d' /etc/apt/sources.list
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN sed -i '/jessie\/updates/d' /etc/apt/sources.list

RUN apt update --allow-unauthenticated

RUN apt install --allow-unauthenticated -y --force-yes unzip ca-certificates

RUN docker-php-ext-install pcntl > /dev/null

RUN curl -o /usr/bin/composer https://getcomposer.org/composer-1.phar && chmod +x /usr/bin/composer
6 changes: 6 additions & 0 deletions .github/prepare-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ __DIR__=$(cd `dirname $0`; pwd)

cd $__DIR__

if [[ `expr $PHP_DOCKER_VERSION \< 7` -eq 0 ]]; then
export PHP_DOCKER_FILE="php.dockerfile"
else
export PHP_DOCKER_FILE="php-5.dockerfile"
fi

containerName=$1

docker-compose up -d $containerName \
Expand Down

0 comments on commit 73e8018

Please sign in to comment.