Skip to content

Commit

Permalink
Merge branch 'master' of github.com:symfony-cmf/cmf-sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectricMaxxx committed Jul 28, 2017
2 parents 270cfe6 + e6359ca commit 04b0e98
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ web:
# robots.txt.
- /robots\.txt$

crons:
reset:
# reset the demo every night to avoid overflowing disks and data leftovers
spec: 30 2 * * *
cmd: 'bin/console cache:clear --env=prod && bin/console doctrine:phpcr:init:dbal --drop --force -n && bin/console doctrine:phpcr:repository:init -n && bin/console doctrine:phpcr:fixtures:load -n && bin/console --env=prod cache:warmup -n --no-debug'

# The size of the persistent disk of the application (in MB).
disk: 2048

Expand Down
20 changes: 13 additions & 7 deletions web/reload-fixtures.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<pre>
<?php

$output = $return_var = null;
$command = __DIR__.'/../bin/console -v doctrine:phpcr:fixtures:load -e=prod';
echo "Running: $command\n";
exec($command, $output, $return_var);
function runCommand($command)
{
$output = $return_var = null;
echo "Running: $command\n";
exec($command, $output, $return_var);

if (empty($output) || !is_array($output)) {
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
exit(1);
}

if (!empty($output) && is_array($output)) {
echo "Output:\n";
foreach ($output as $line) {
echo $line."\n";
}
} else {
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
}

runCommand(__DIR__.'/../bin/console cache:clear -e=prod');
runCommand(__DIR__.'/../bin/console -v doctrine:phpcr:fixtures:load -e=prod');

0 comments on commit 04b0e98

Please sign in to comment.