Skip to content

Commit ac2e688

Browse files
committed
refacto(travis): refacto travis ci
1 parent c5b052f commit ac2e688

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

.travis.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,32 @@ language: php
33
php:
44
- 7.1
55

6+
services:
7+
- mysql
8+
9+
env:
10+
- APP_ENV=dev
11+
URL=local.appbuild.com
12+
DB_URL=mysql://root@127.0.0.1/appbuild_db
13+
SYMFONY_SECRET=ThisTokenIsNotSoSecretChangeIt
14+
DEFAULT_LOCALE=en
15+
TIMEZONE=UTC
16+
SESSION_SAVE_PATH=%kernel.project_dir%/var/sessions/%kernel.environment%
17+
BUILDS_APPLICATION_DIR=%kernel.project_dir%/var/build_files
18+
MAILER_TRANSPORT=smtp
19+
MAILER_HOST=127.0.0.1
20+
MAILER_USER=null
21+
MAILER_PASSWORD=null
22+
WEBPACK_DEV_SERVER_BASE_URL=http://local.appbuild.com:8080
23+
JWT_PRIVATE_KEY_PATH=%kernel.project_dir%/var/jwt/private.pem
24+
JWT_PUBLIC_KEY_PATH=%kernel.project_dir%/var/jwt/public.pem
25+
JWT_KEY_PASS_PHRASE=Appbuild
26+
JWT_TOKEN_TTL=31536000
27+
628
before_script:
29+
- cp .env.dist .env
730
- nvm install "$(jq -r '.engines.node' package.json)"
8-
- make install-bin-dev install-bin-prod install-composer install-npm db-build assets-build
31+
- make install-bin-dev install-bin-prod install-composer install-npm db-build-test assets-build
932

1033
script:
1134
- npm run lint

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ db-build:
4040
php bin/console doctrine:fixtures:load -n --fixtures=src/UserBundle
4141
php bin/console hautelook_alice:doctrine:fixtures:load -n --append
4242

43+
# Database
44+
db-build-test:
45+
php bin/console doctrine:database:create
46+
php bin/console doctrine:schema:update --force
47+
php bin/console doctrine:fixtures:load -n --fixtures=src/UserBundle
48+
php bin/console hautelook_alice:doctrine:fixtures:load -n --append --bundle=AppbuildApplicationBundle
49+
4350
db-trash:
4451
php bin/console doctrine:database:drop --force --if-exists
4552
php bin/console doctrine:database:create

app/config/config_test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ swiftmailer:
1717

1818
doctrine:
1919
dbal:
20-
driver: 'pdo_sqlite'
21-
path: '%kernel.cache_dir%/appbuild.sqlite.db'
22-
charset: 'UTF8'
20+
url: '%env(DB_URL)%'
21+
orm:
22+
auto_generate_proxy_classes: '%kernel.debug%'
23+
naming_strategy: 'doctrine.orm.naming_strategy.underscore'
24+
auto_mapping: true

src/ApplicationBundle/Features/Context/ApplicationIntegrationContext.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function truncateBdd(BeforeScenarioScope $scope)
8585
$schemaManager = $connection->getSchemaManager();
8686
foreach ($schemaManager->listTables() as $table) {
8787
$connection->exec(sprintf('DELETE FROM %s', $table->getName()));
88+
$connection->exec(sprintf('ALTER TABLE %s AUTO_INCREMENT = 1', $table->getName()));
8889
}
8990
}
9091

0 commit comments

Comments
 (0)