Skip to content

Commit

Permalink
Merge pull request #79 from szymach/new_release
Browse files Browse the repository at this point in the history
Require stable FSi components, replaced Vagrant with Docker
  • Loading branch information
rn0 authored Jun 28, 2018
2 parents fce619f + b65717f commit 963b6b3
Show file tree
Hide file tree
Showing 34 changed files with 115 additions and 399 deletions.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/vendor/
/bin/
/composer.phar
/composer.lock
/vagrant/.vagrant
!/features/fixtures/project/web/app_test.php
/features/fixtures/project/web/*
/features/fixtures/project/web/uploaded
/features/fixtures/project/web/bundles
/features/fixtures/project/app/data.sqlite
/features/fixtures/project/web/bundles
/features/fixtures/project/web/uploaded
/vendor/
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
language: php

sudo: true

cache:
directories:
- $HOME/.composer/cache
- bin
- vendor

sudo: required

addons:
firefox: "47.0.1"

Expand All @@ -22,19 +20,20 @@ before_install:
- phpenv config-rm xdebug.ini
- composer update $COMPOSER_FLAGS
- composer validate
- wget --no-clobber -O bin/selenium.jar http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar || true
- wget --no-clobber -O vendor/bin/selenium.jar http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar || true

before_script:
- nohup php -S localhost:8080 -t features/fixtures/project/web > server.log 2>&1 &
- features/fixtures/project/app/console assets:install features/fixtures/project/web --relative --symlink
- features/fixtures/project/app/console ckeditor:install --clear=skip
- features/fixtures/project/app/console assets:install --symlink features/fixtures/project/web
- sh -e /etc/init.d/xvfb start
- export DISPLAY=:99.0
- java -jar bin/selenium.jar > /dev/null 2>&1 &
- java -jar vendor/bin/selenium.jar > /dev/null 2>&1 &
- sleep 5

script:
- bin/phpspec run -f progress -v
- bin/behat --no-snippets --verbose --profile=travis -v
- vendor/bin/phpspec run -f progress
- vendor/bin/behat --no-snippets --profile=travis

after_failure:
- cat /tmp/FSiAdminTranslatableBundle/logs/test.log
Expand Down
7 changes: 6 additions & 1 deletion behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ default: &default
- FSi\Bundle\AdminTranslatableBundle\Behat\Context\PopoverContext
extensions:
Behat\MinkExtension:
base_url: 'http://admin-translatable-bundle-web'
sessions:
default:
symfony2: ~
javascript:
selenium2:
browser: firefox
base_url: 'http://fsi-admin-translatable-bundle.dev/app_test.php/'
wd_host: http://admin-translatable-bundle-selenium:4444/wd/hub
javascript_session: javascript
Behat\Symfony2Extension:
kernel:
Expand All @@ -32,3 +33,7 @@ travis:
extensions:
Behat\MinkExtension:
base_url: "http://localhost:8080/app_test.php"
sessions:
javascript:
selenium2:
wd_host: http://localhost:4444/wd/hub
17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
}
],
"require": {
"fsi/admin-bundle": "^3.0",
"fsi/doctrine-extensions-bundle": "^2.0",
"php": ">=7.1",
"symfony/form": "^2.8|^3.0|^4.0",
"symfony/framework-bundle": "^2.8|^3.0|^4.0",
Expand All @@ -20,27 +22,20 @@
"symfony/translation": "^2.6|^3.0|^4.0",
"symfony/twig-bridge": "^3.0.3|^4.0",
"symfony/validator": "^2.5|^3.0|^4.0",
"symfony/twig-bundle": "^2.8|^3.0|^4.0",
"fsi/admin-bundle": "^3.0@dev",
"fsi/doctrine-extensions-bundle": "^2.0@dev",
"fsi/doctrine-extensions": "^2.0@dev"
"symfony/twig-bundle": "^2.8|^3.0|^4.0"
},
"require-dev": {
"behat/behat": "^3.3",
"behat/mink": "^1.7@dev",
"behat/mink": "^1.7",
"behat/mink-browserkit-driver": "^1.3",
"behat/mink-extension": "^2.2",
"behat/mink-selenium2-driver": "^1.3",
"behat/symfony2-extension": "^2.1",
"bossa/phpspec2-expect": "^2.0|^3.0",
"doctrine/doctrine-bundle": "^1.6",
"ext-pdo_sqlite": "*",
"fsi/datagrid": "^2.0@dev",
"fsi/datagrid-bundle": "^2.0@dev",
"fsi/datasource": "^2.0@dev",
"fsi/datasource-bundle": "^2.0@dev",
"fsi/resource-repository-bundle": "^2.0@dev",
"friendsofsymfony/ckeditor-bundle": "^1.0",
"fsi/resource-repository-bundle": "^2.0",
"phpspec/phpspec": "^3.4.2|^4.0",
"phpspec/prophecy": "^1.7.2",
"sensiolabs/behat-page-object-extension": "^3.0@dev",
Expand All @@ -53,7 +48,7 @@
"twig/twig": "^1.34|^2.0"
},
"config": {
"bin-dir": "bin"
"bin-dir": "vendor/bin"
},
"autoload": {
"psr-4": {
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
version: '3'

services:
web:
build:
context: ./docker
dockerfile: web
container_name: admin-translatable-bundle-web
ports:
- 80:80
- 443:443
environment:
PHP_IDE_CONFIG: 'serverName=localhost'
HOST_UID: 1000
HOST_GID: 1000
volumes:
- .:/var/www/application
- ~/.composer:/var/www/.composer
selenium:
image: selenium/standalone-firefox:2.53.1
container_name: admin-translatable-bundle-selenium
17 changes: 17 additions & 0 deletions docker/apache-config.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<VirtualHost *:80>
DocumentRoot /var/www/application/features/fixtures/project/web
ServerName localhost
ErrorLog /dev/stdout
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/application/features/fixtures/project/web
ServerName localhost
ErrorLog /dev/stdout
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
<Directory /var/www/application/features/fixtures/project>
Options FollowSymLinks
AllowOverride All
</Directory>
5 changes: 5 additions & 0 deletions docker/web
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM fsiopen/docker-php-apache:7.1

USER root

ADD apache-config.conf /etc/apache2/sites-available/application.conf
2 changes: 1 addition & 1 deletion features/fixtures/project/app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
locale: en
locale: en

services:
test.admin.manager:
Expand Down
45 changes: 45 additions & 0 deletions features/fixtures/project/web/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
DirectoryIndex app_test.php

SetEnvIf Server_Addr ^10\.0\.0\.200 development=on
SetEnvIf Server_Addr ^172\. development=on

<IfModule mod_php7.c>
php_value post_max_size 32M
php_value upload_max_filesize 32M
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On

# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
# resolution of the app.php file and to redirect to the correct URI. It will
# work in environments without path prefix as well, providing a safe, one-size
# fits all solution. But as you do not need it in this case, you can comment
# the following 2 lines to eliminate the overhead.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]

# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]

RewriteRule .? %{ENV:BASE}/app_test.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
# When mod_rewrite is not available, we instruct a temporary redirect of
# the start page to the front controller explicitly so that the website
# and the generated links can still be used.
RedirectMatch 302 ^/$ /app_test.php/
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>

<IfModule mod_headers.c>
Header set Cache-control "no-cache" env=development
Header unset expires env=development
</IfModule>
2 changes: 2 additions & 0 deletions features/fixtures/project/web/app_test.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;

Expand Down
21 changes: 0 additions & 21 deletions vagrant/Vagrantfile

This file was deleted.

3 changes: 0 additions & 3 deletions vagrant/provisioning/roles/apache/handlers/main.yml

This file was deleted.

40 changes: 0 additions & 40 deletions vagrant/provisioning/roles/apache/tasks/main.yml

This file was deleted.

14 changes: 0 additions & 14 deletions vagrant/provisioning/roles/apache/templates/virtualhost.j2

This file was deleted.

2 changes: 0 additions & 2 deletions vagrant/provisioning/roles/apache/vars/main.yml

This file was deleted.

3 changes: 0 additions & 3 deletions vagrant/provisioning/roles/composer/tasks/main.yml

This file was deleted.

14 changes: 0 additions & 14 deletions vagrant/provisioning/roles/java/tasks/main.yml

This file was deleted.

4 changes: 0 additions & 4 deletions vagrant/provisioning/roles/mysql/handlers/main.yml

This file was deleted.

29 changes: 0 additions & 29 deletions vagrant/provisioning/roles/mysql/tasks/main.yml

This file was deleted.

3 changes: 0 additions & 3 deletions vagrant/provisioning/roles/mysql/templates/.my.cnf.j2

This file was deleted.

Loading

0 comments on commit 963b6b3

Please sign in to comment.