forked from sonata-project/sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
67 lines (67 loc) · 3.37 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<project name="sonata-sandbox" default="initialize-project" basedir=".">
<target name="initialize-project">
<!-- TODO: check for existence of app/config/parameters.yml -->
<property name="app.uploadsDir" value="./public/uploads/media"/>
<if>
<os family="windows"/>
<then>
<property name="app.console" value="bin\console.bat"/>
</then>
<else>
<property name="app.console" value="bin/console"/>
</else>
</if>
<echo msg="Preparing ${app.uploadsDir} folder"/>
<delete dir="${app.uploadsDir}" includeemptydirs="true" failonerror="false"/>
<mkdir dir="${app.uploadsDir}"/>
<echo msg="Removing any existing cache"/>
<foreach param="dir" absparam="path" target="delete-dir">
<fileset dir="./var/cache">
<type type="dir"/>
<depth max="0" min="0"/>
</fileset>
</foreach>
<echo msg="Warming up cache for production environment"/>
<!-- TODO: Is this even needed? -->
<SymfonyConsole console="${app.console}" command="cache:clear" checkReturn="true">
<arg name="env" value="prod"/>
<arg name="no-warmup"/>
</SymfonyConsole>
<echo msg="Preparing database"/>
<SymfonyConsole console="${app.console}" command="doctrine:database:drop" checkReturn="true">
<arg name="force"/>
<arg name="if-exists"/>
<!-- TODO: Fallback to doctrine:schema:drop in case user doesn't have permissions to drop/create databases? -->
</SymfonyConsole>
<SymfonyConsole console="${app.console}" command="doctrine:database:create" checkReturn="true"/>
<SymfonyConsole console="${app.console}" command="doctrine:schema:update" checkReturn="true">
<arg name="force"/>
<arg name="dump-sql"/>
</SymfonyConsole>
<SymfonyConsole console="${app.console}" command="doctrine:fixtures:load" checkReturn="true">
<!--<arg name="verbose"/>-->
<arg name="no-interaction"/>
</SymfonyConsole>
<echo msg="Preparing sonata news and page bundles"/>
<SymfonyConsole console="${app.console}" command="sonata:news:sync-comments-count" checkReturn="true"/>
<SymfonyConsole console="${app.console}" command="sonata:page:update-core-routes" checkReturn="true">
<arg name="site" value="all"/>
</SymfonyConsole>
<SymfonyConsole console="${app.console}" command="sonata:page:create-snapshots" checkReturn="true">
<arg name="site" value="all"/>
</SymfonyConsole>
<echo msg="Preparing ACLs"/>
<SymfonyConsole console="${app.console}" command="sonata:admin:setup-acl" checkReturn="true"/>
<SymfonyConsole console="${app.console}" command="sonata:admin:generate-object-acl" checkReturn="true"/>
<!-- TODO: check for existence of yarn|npm -->
<echo msg="Generating assets"/>
<SymfonyConsole console="${app.console}" command="assets:install" checkReturn="true"/>
<!--
<SymfonyConsole console="yarn" command="encore dev" checkReturn="true"/>
-->
</target>
<target name="delete-dir" hidden="true">
<delete dir="${path}" includeemptydirs="true" failonerror="true"/>
</target>
</project>