Skip to content
Snippets Groups Projects
Unverified Commit 13e064b7 authored by Antonio De Marco's avatar Antonio De Marco Committed by GitHub
Browse files

Issue #169: Integrate OpenEuropa Task Runner and add Docker Compose integration

parent cd88b216
Branches
Tags
No related merge requests found
2.2.2
language: php
dist: precise
sudo: required
php:
- 7.0
services:
- docker
- docker-compose
env:
global:
env:
global:
- PATH=$PATH:/home/travis/.composer/vendor/bin:$TRAVIS_BUILD_DIR/vendor/bin
- DOCKER_COMPOSE_VERSION=1.17.1
matrix:
- DRUPAL_VERSION=8.3.x-dev
- DRUPAL_VERSION=8.4.x-dev
......@@ -16,34 +14,24 @@ env:
matrix:
allow_failures:
- php: 7.0
env: DRUPAL_VERSION=8.5.x-dev
- env: DRUPAL_VERSION=8.5.x-dev
before_install:
- docker-compose up -d
- docker ps
install:
- composer self-update
- composer require drupal/core:$DRUPAL_VERSION --dev --prefer-dist
- docker-compose exec -u root php composer require drupal/core:$DRUPAL_VERSION --dev --prefer-dist
before_script:
# Start PhantomJS server.
- phantomjs --webdriver=4444 > /dev/null &
# Set sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path=`which true`" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Create database.
- mysql -e 'create database drupal'
# Install Drupal 8 target site.
- drush --root=$PWD/build si standard -y --db-url=mysql://travis:@127.0.0.1/drupal
# Force exit status to true so expected patterns validation error will not stop Travis build.
- drush --root=$PWD/build en ui_patterns_test -y || true
- drush --root=$PWD/build cr
# Run Drush web server.
- drush --root=$PWD/build --debug runserver :8888 > ~/debug.txt 2>&1 &
- sleep 4s
- docker-compose exec -u root php ./vendor/bin/run drupal:site-setup
- docker-compose exec -u root php ./vendor/bin/run drupal:site-install
- docker-compose exec -u root php chown -R www-data:www-data build
script:
- cd $TRAVIS_BUILD_DIR
- phpunit
- behat
- grumphp run
- docker-compose exec -u root php ./vendor/bin/grumphp run
- docker-compose exec -u root php ./vendor/bin/phpunit
- docker-compose exec -u root php ./vendor/bin/behat
notifications:
email: false
email: false
\ No newline at end of file
......@@ -19,14 +19,14 @@ default:
extensions:
Behat\MinkExtension:
goutte: ~
selenium2: ~
selenium2:
wd_host: 'http://selenium:4444/wd/hub'
javascript_session: selenium2
base_url: http://127.0.0.1:8888
base_url: "${drupal.base_url}"
NuvoleWeb\Drupal\DrupalExtension:
api_driver: 'drupal'
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: 'build'
drupal_root: "${drupal.root}"
region_map:
left sidebar: '#sidebar-first'
content: '#content'
......@@ -39,7 +39,5 @@ default:
error_message_selector: '.alert.alert-danger'
text:
node_submit_label: 'Save and publish'
Bex\Behat\ScreenshotExtension:
active_image_drivers: img42
formatters:
progress: ~
version: "2"
services:
mariadb:
image: wodby/mariadb:10.1-2.3.5
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal
php:
image: wodby/drupal-php:7.0-3.0.0
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
PHP_FPM_CLEAR_ENV: "no"
DB_HOST: mariadb
DB_USER: drupal
DB_PASSWORD: drupal
DB_NAME: drupal
DB_DRIVER: mysql
PHP_XDEBUG: 1
PHP_XDEBUG_DEFAULT_ENABLE: 1
PHP_XDEBUG_REMOTE_CONNECT_BACK: 1
PHP_XDEBUG_REMOTE_HOST: "10.254.254.254"
PHP_XDEBUG_IDEKEY: "PHPSTORM"
PHP_IDE_CONFIG: "serverName=ui_patterns"
COMPOSER_HOME: "/composer"
volumes:
- ./:/var/www/html
- ~/.bash_history:/root/.bash_history
- ~/.bashrc.aliases:/root/.bashrc
- ~/.composer/cache:/composer/cache
nginx:
image: wodby/drupal-nginx:8-1.13-3.0.1
depends_on:
- php
environment:
NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/build
volumes:
- ./:/var/www/html
labels:
- 'traefik.backend=nginx'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:ui_patterns.localhost'
traefik:
image: traefik
command: -c /dev/null --web --docker --logLevel=INFO
ports:
- '80:80'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
selenium:
image: selenium/standalone-firefox-debug:2.53.1-beryllium
ports:
- "5900:5900"
expose:
- '4444'
volumes:
codebase:
......@@ -52,3 +52,27 @@ you'll still need to manually disable Twig and other Drupal 8 caching by un-comm
# include $app_root . '/' . $site_path . '/settings.local.php';
# }
Docker Compose
--------------
UI Patterns ships with a ``docker-compose.yml`` file which can be used to streamline local development and tests execution.
In the project root run:
.. code-block:: bash
$ docker-compose up -d
$ docker-compose exec -u root php composer install
$ docker-compose exec -u root php ./vendor/bin/run drupal:site-setup
$ docker-compose exec -u root php ./vendor/bin/run drupal:site-install
$ docker-compose exec -u root php chown -R www-data:www-data build
You'll then have a fully functional test site at `http://ui_patterns.localhost <http://ui_patterns.localhost>`_.
You can then run all tests as follows:
.. code-block:: bash
$ docker-compose exec -u root php ./vendor/bin/grumphp run
$ docker-compose exec -u root php ./vendor/bin/phpunit
$ docker-compose exec -u root php ./vendor/bin/behat
......@@ -9,7 +9,7 @@ parameters:
- build/
- vendor/
- tests/
- ui_patterns/modules/ui_patterns_test/
- modules/ui_patterns_test/
triggered_by:
- php
- module
......
......@@ -4,7 +4,8 @@
<ini name="error_reporting" value="32767"/>
<var name="namespaces" value=""/>
<ini name="memory_limit" value="-1"/>
<env name="SIMPLETEST_DB" value="mysql://travis:@127.0.0.1/drupal"/>
<env name="SIMPLETEST_BASE_URL" value="${drupal.base_url}"/>
<env name="SIMPLETEST_DB" value="mysql://${drupal.database.user}:${drupal.database.password}@${drupal.database.host}:${drupal.database.port}/${drupal.database.name}"/>
</php>
<testsuites>
<testsuite name="unit">
......
drupal:
root: "build"
base_url: "http://nginx"
database:
host: "mariadb"
port: "3306"
name: "drupal"
user: "drupal"
password: "drupal"
post_install:
- "./vendor/bin/drush en -y ui_patterns_test"
- "./vendor/bin/drush cr"
commands:
drupal:site-setup:
- { task: "run", command: "drupal:drush-setup" }
- { task: "run", command: "drupal:settings-setup" }
- { task: "run", command: "setup:behat" }
- { task: "run", command: "setup:phpunit" }
setup:behat:
- { task: "process", source: "behat.yml.dist", destination: "behat.yml" }
setup:phpunit:
- { task: "process", source: "phpunit.xml.dist", destination: "phpunit.xml" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment