From 180140130b71c1799771c6daab6bbc8322b3d67f Mon Sep 17 00:00:00 2001 From: Sander Van Dooren Date: Thu, 8 Mar 2018 16:52:09 +0100 Subject: [PATCH] Docker, drone, compose all the things! --- .drone.yml | 20 ++++++++++++++++++++ composer.json | 2 +- docker-compose.yaml | 18 ++++++++++++++++++ index.php | 10 +++++++--- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 .drone.yml create mode 100644 docker-compose.yaml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..8cfa155 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +# Declare a pipeline +pipeline: + # Declare pipeline step + composer-install: + # Use image for step + image: fpfis/php71-build + # Run commands from this image + commands: + - composer install --ansi + + # Declare another step + lint-code: + image: fpfis/php71-build + commands: + - php -l index.php + + run-code: + image: fpfis/php71-build + commands: + - php index.php diff --git a/composer.json b/composer.json index e7ac977..00e7dd8 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { "require": { - "symfony/yaml" : "*", + "symfony/yaml" : "*" } } diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c720c33 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,18 @@ +version: '2' +services: + + # Define a PHP webserver + php-webserver: + # Use a PHP image with apache + image: fpfis/php71-dev + # Define settings + environment: + - XDEBUG=true + - DOCUMENT_ROOT=/app/build + # Mount a local volume in the container + volumes: + - ./:/app/build + # Share the container port with the host + ports: + - 8080:8080 + diff --git a/index.php b/index.php index 03efc33..436c3fa 100644 --- a/index.php +++ b/index.php @@ -5,9 +5,13 @@ use Symfony\Component\Yaml\Yaml; -$array = array( +$array = [ + 'foo' => 'bar', + 'bar' => [ 'foo' => 'bar', - 'bar' => array('foo' => 'bar', 'bar' => 'baz' => 'test'), -); + 'bar' => 'baz', + 'test' + ], +]; echo Yaml::dump($array);