Skip to content

Commit e1f62db

Browse files
Add .travis.yml with webid-provider-tests
1 parent 9f3edd5 commit e1f62db

5 files changed

Lines changed: 84 additions & 0 deletions

File tree

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile
2+
.git

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sudo: false
2+
language: php
3+
script:
4+
- sh run-solid-test-suite.sh

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM php:7.2-apache
2+
RUN apt-get update && \
3+
apt-get install -y \
4+
git \
5+
zlib1g-dev
6+
WORKDIR /tls
7+
RUN openssl req -new -x509 -days 365 -nodes \
8+
-out server.cert \
9+
-keyout server.key \
10+
-subj "/C=RO/ST=Bucharest/L=Bucharest/O=IT/CN=www.example.ro"
11+
RUN docker-php-ext-install mysqli pdo pdo_mysql zip mbstring
12+
RUN a2enmod rewrite
13+
RUN a2enmod ssl
14+
WORKDIR /install
15+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
16+
RUN php composer-setup.php
17+
RUN php -r "unlink('composer-setup.php');"
18+
ADD . /app
19+
WORKDIR /app
20+
RUN php /install/composer.phar install --no-dev --prefer-dist
21+
COPY site.conf /etc/apache2/sites-enabled/site.conf
22+
EXPOSE 443

run-solid-test-suite.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Run the Solid test-suite
5+
docker network create testnet
6+
7+
# Build and start Nextcloud server with code from current repo contents:
8+
docker build -t server .
9+
docker run -d --name server --network=testnet server
10+
11+
docker build -t webid-provider https://github.com/pdsinterop/test-suites.git#master:/testers/webid-provider
12+
docker build -t cookie https://github.com/pdsinterop/test-suites.git#master:servers/php-solid-server/cookie
13+
wget -O /tmp/env-vars-for-test-image.list https://raw.githubusercontent.com/solid/test-suite/master/servers/php-solid-server/env.list
14+
until docker run --rm --network=testnet webid-provider curl -kI https://server 2> /dev/null > /dev/null
15+
do
16+
echo Waiting for server to start, this can take up to a minute ...
17+
docker ps -a
18+
docker logs server || true
19+
sleep 1
20+
done
21+
docker ps -a
22+
docker logs server
23+
24+
echo Getting cookie...
25+
export COOKIE="`docker run --cap-add=SYS_ADMIN --network=testnet --env-file /tmp/env-vars-for-test-image.list cookie`"
26+
echo "Running webid-provider tests with cookie $COOKIE"
27+
docker run --rm --network=testnet --env COOKIE="$COOKIE" --env-file /tmp/env-vars-for-test-image.list webid-provider
28+
# rm /tmp/env-vars-for-test-image.list
29+
# docker stop server
30+
# docker rm server
31+
# docker network remove testnet

site.conf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<VirtualHost *:443>
2+
DocumentRoot "/app/web/"
3+
ErrorLog ${APACHE_LOG_DIR}/error.log
4+
CustomLog ${APACHE_LOG_DIR}/access.log combined
5+
6+
SSLEngine on
7+
SSLCertificateFile "/tls/server.cert"
8+
SSLCertificateKeyFile "/tls/server.key"
9+
10+
<FilesMatch "\.(cgi|shtml|phtml|php)$">
11+
SSLOptions +StdEnvVars
12+
</FilesMatch>
13+
14+
<Directory /app/web>
15+
Options Indexes FollowSymLinks
16+
AllowOverride all
17+
Require all granted
18+
</Directory>
19+
DirectoryIndex index.php
20+
21+
<IfModule mod_rewrite.c>
22+
RewriteEngine On
23+
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA]
24+
</IfModule>
25+
</VirtualHost>

0 commit comments

Comments
 (0)