diff --git a/.gitignore b/.gitignore index 032708f..cfa0b82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ config.php cache/*.cache + +# IDEs /.project +/nbproject +/.vscode \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5b8edc9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: php + +sudo: required + +services: + - docker + +before_install: + - make + +script: + - make lint diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2b15d4f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM php:7-alpine + +ADD . /usr/src/code +WORKDIR /usr/src/code diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8f61922 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all: images + +images: + docker-compose build + +up: + docker-compose up de-map + +lint: + docker-compose run --rm php sh -c 'find . -name "*.php" -print0 | xargs -0 -n1 php -l' diff --git a/README.md b/README.md index 493108a..5cc376a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/mjainta/de-map.svg?branch=master)](https://travis-ci.org/mjainta/de-map) + de-map ====== @@ -24,3 +26,29 @@ Das JSON-Schema ist in schema/nodelist-schema.json zu finden, gegen das man die Für den Export dieser Liste habe ich 2 PHP-Klassen beispielhaft implementiert https://github.com/StilgarBF/nodelistexport Die Karte wird dieses Format in Kürze auch verarbeiten. + +### Docker + +Build the images + +```shell +make +``` + +Do a linting on all php-files + +```shell +make lint +``` + +Fire a php server with de-map running data.php up (does not use code changed after `make` or `make images`) + +```shell +make up +``` + +Execute a single command for the current source code (development) + +```shell +docker-compose run --rm php php data.php +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7d56d08 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '2' +services: + php: + build: . + image: "php" + volumes: + - .:/usr/src/code + + de-map: + build: . + command: php data.php