From 6c4851134d1463d62abbf7d5438a9a053fbd25b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 30 Jan 2015 18:29:34 +0100 Subject: [PATCH] Add migrations to custom field travis build refs #402 --- .travis.yml | 34 +++++++++---------- Tests/Fixtures/App/app/AppKernel.php | 3 +- .../App/app/DoctrineMigrations/.gitignore | 2 ++ composer.json | 22 +++++++++--- 4 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 Tests/Fixtures/App/app/DoctrineMigrations/.gitignore diff --git a/.travis.yml b/.travis.yml index 04cb0d311..f11f008f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,26 @@ language: php php: - - 5.5 - - 5.6 - - hhvm-nightly - +- 5.5 +- 5.6 +- hhvm-nightly matrix: allow_failures: - - php: hhvm-nightly - + - php: hhvm-nightly addons: - postgresql: "9.3" - + postgresql: '9.3' +install: + - composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH + - composer install --dev + - cp Tests/Fixtures/App/app/config/parameters.travis.yml Tests/Fixtures/App/app/config/parameters.yml before_script: - psql -c 'create database test0;' -U postgres - - cp Tests/Fixtures/App/app/config/parameters.travis.yml Tests/Fixtures/App/app/config/parameters.yml - - ./console.sh --env=test cache:warmup - - ./console.sh doctrine:schema:create --no-interaction --env=test - - ./console.sh doctrine:fixtures:load --no-interaction --env=test - -install: - - composer install --dev - + - "./console.sh --env=test cache:warmup" + - "./console.sh doctrine:migrations:migrate --no-interaction" + - "./console.sh doctrine:fixtures:load --no-interaction --env=test" script: phpunit --coverage-text - notifications: email: - - info@champs-libres.coop + - info@champs-libres.coop +env: + global: + secure: MoVsISTKaeamuFNoylDv/nM6NBXBtCoH5tuGwX3RHpRK/zRXh421RgO8z/GTHxGt63r04EfYrsCXXng8fN4ZVA2Bjb9chGAozYZJOSwZ9Vmfjycu3k0v/+hikAj33DT+CEdVk4fggEZh5dcVbaJDRgaUZkwMLUtyCqeiv+J5X68= diff --git a/Tests/Fixtures/App/app/AppKernel.php b/Tests/Fixtures/App/app/AppKernel.php index 1f1941221..7792f0ce6 100644 --- a/Tests/Fixtures/App/app/AppKernel.php +++ b/Tests/Fixtures/App/app/AppKernel.php @@ -15,7 +15,8 @@ class AppKernel extends Kernel new \Symfony\Bundle\AsseticBundle\AsseticBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new \Chill\MainBundle\ChillMainBundle, - new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle() + new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), + new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle() #add here all the required bundle (some bundle are not required) ); } diff --git a/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore b/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/composer.json b/composer.json index 441e9a23c..9a5f2ac38 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,13 @@ "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~3.0", "sensio/framework-extra-bundle": "~3.0", - "chill-project/main": "*@dev" + "chill-project/main": "*@dev", + "champs-libres/composer-bundle-migration": "~1.0", + "doctrine/doctrine-migrations-bundle": "dev-master@dev", + "doctrine/migrations": "~1.0@dev" + }, + "require-dev": { + "doctrine/doctrine-fixtures-bundle": "~2.2@dev" }, "scripts": { "post-install-cmd": [ @@ -38,10 +44,16 @@ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap" ] }, - "extra": { - "symfony-app-dir": "Tests/Fixtures/App/app" + "scripts": { + "post-install-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ], + "post-update-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ] }, - "require-dev": { - "doctrine/doctrine-fixtures-bundle": "~2.2@dev" + "extra": { + "symfony-app-dir": "Tests/Fixtures/App/app", + "app-migrations-dir": "Tests/Fixtures/App/app/DoctrineMigrations" } }