Skip to content

Commit 8160553

Browse files
Merge pull request #400 from symfony-cmf/an_other_try
try to get the output
2 parents e7e8da7 + 0604eda commit 8160553

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.platform.app.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ web:
4545
cron:
4646
symfony:
4747
spec: '* */2 * * *'
48-
cmd: ./bin/reloadFixtures.sh $PWD
48+
cmd: ./bin/reloadFixtures.sh $PWD true
4949

5050
# The size of the persistent disk of the application (in MB).
5151
disk: 2048
@@ -58,16 +58,12 @@ mounts:
5858
# The hooks that will be performed when the package is deployed.
5959
hooks:
6060
build: |
61-
if [ "$PLATFORM_BRANCH" = master ]; then
62-
rm web/app_dev.php
63-
else
64-
echo "only remove app_dev.php on master"
65-
fi
61+
rm web/app_dev.php
6662
# place sqlite file into /tmp so that we can write to it during deploy
6763
sed -i 's@%kernel.root_dir%/../var/app.sqlite@/tmp/app.sqlite@' app/config/parameters.yml
6864
bin/console --env=prod assets:install -n --no-debug
6965
bin/console --env=prod assetic:dump -n --no-debug
70-
deploy: ./bin/reloadFixtures.sh $PWD
66+
deploy: ./bin/reloadFixtures.sh $PWD true
7167

7268
runtime:
7369
extensions:

bin/reloadFixtures.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
#!/usr/bin/env bash
22

33
DIR=$1
4+
PROD=$2||false
45
run () {
56
comment="+++ "$1" +++"
67
command=$2
78
echo ${comment}
89
echo "Command: "${command}
9-
${command}
10+
${command} > /tmp/output 2> /tmp/error
1011
OUT=$?
1112
if [ ${OUT} -eq 0 ];then
1213
echo "+++ DONE +++"
14+
cat /tmp/output
1315
echo
1416
else
1517
echo "+++ Errors +++"
18+
cat /tmp/output
19+
cat /tmp/error
1620
exit ${OUT}
1721
fi
1822
}
1923

2024
CACHE_DIR=${DIR}var/cache/prod
21-
#run "Remove cache directory:" "rm -rf ${CACHE_DIR}"
22-
run "Drop and init dbal:" "php ${DIR}bin/console --env=prod doctrine:phpcr:init:dbal --drop --force -n"
23-
run "Init repositories:" "php ${DIR}bin/console --env=prod doctrine:phpcr:repository:init -n"
24-
run "Load date fixtures:" "php ${DIR}bin/console --env=prod doctrine:phpcr:fixtures:load -n"
25-
run "Warm up cache:" "php ${DIR}bin/console --env=prod cache:warmup -n --no-debug"
25+
if [ "${PROD}" ]; then
26+
run "Remove cache directory:" "rm -rf /var/cache/prod"
27+
else
28+
run "Remove cache directory:" "rm -rf ${DIR}var/cache/prod"
29+
fi
30+
run "Drop and init dbal:" "php ${DIR}bin/console --env=prod doctrine:phpcr:init:dbal --drop --force -n -vvv"
31+
run "Init repositories:" "php ${DIR}bin/console --env=prod doctrine:phpcr:repository:init -n -vvv"
32+
run "Load date fixtures:" "php ${DIR}bin/console --env=prod doctrine:phpcr:fixtures:load -n -vvv"
33+
run "Warm up cache:" "php ${DIR}bin/console --env=prod cache:warmup -n --no-debug -vvv"

0 commit comments

Comments
 (0)