Skip to content

Commit 88532a5

Browse files
Create docker file to use with travis
1 parent 3f31add commit 88532a5

File tree

4 files changed

+36
-25
lines changed

4 files changed

+36
-25
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

.travis.yml

+4-25
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
11
language: php
22

3-
php:
4-
- 7.3
5-
6-
env:
7-
- REPORT_EXIT_STATUS=1
3+
services:
4+
- docker
85

96
before_install:
10-
- sudo add-apt-repository -y ppa:team-xbmc/ppa
11-
- sudo apt-get update -qq
12-
- |
13-
travis_retry curl -L https://www.libsdl.org/release/SDL2-2.0.8.tar.gz | tar xz
14-
pushd SDL2-2.0.8
15-
./configure
16-
make
17-
sudo make install
18-
popd
19-
20-
install:
21-
- sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev
22-
23-
before_script:
24-
- phpize
25-
- ./configure --quiet
26-
- make all install
27-
- echo "extension=sdl.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
28-
- chmod +x run-tests.php
7+
- docker build -t ponup/php-sdl .
298

309
script:
31-
- ./run-tests.php -q -p $(which php) --show-diff
10+
- docker run --rm ponup/php-sdl
3211

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM debian:10
2+
3+
RUN apt-get update
4+
RUN apt-get install -y make build-essential wget
5+
RUN apt-get install -y lsb-release apt-transport-https ca-certificates
6+
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
7+
RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
8+
RUN apt-get update
9+
RUN apt-get install -y php7.4-dev
10+
RUN apt-get install -y libsdl2-dev
11+
RUN apt-get install -y xvfb
12+
COPY . /opt/php-sdl
13+
WORKDIR /opt/php-sdl
14+
RUN phpize
15+
RUN ./configure
16+
RUN make
17+
RUN make install
18+
RUN echo "extension=sdl.so" >> /etc/php/7.4/cli/php.ini
19+
20+
ENTRYPOINT ["/opt/php-sdl/docker-entrypoint.sh"]
21+

docker-entrypoint.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
Xvfb :99 -screen 0 800x600x24 -ac &
4+
5+
chmod +x ./run-tests.php
6+
7+
export DISPLAY=:99
8+
./run-tests.php -q --show-diff
9+
10+
killall -9 Xvfb

0 commit comments

Comments
 (0)