forked from covex-nn/docker-workflow-symfony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
73 lines (58 loc) · 2.98 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
68
69
70
71
72
73
<?xml version="1.0"?>
<project name="Docker Symfony App" default="init" basedir=".">
<property name="composer.path" value="/usr/local/bin/composer" />
<property name="symfony.console" value="bin/console" />
<property name="symfony.env" value="dev" />
<property name="project.storage.dir" value="${project.basedir}/storage" />
<target name="init" depends="composer-install,app-deploy,database-deploy,storage-prepare">
<echo message="${phing.project.name} Init - OK" />
</target>
<target name="composer-install">
<composer composer="${composer.path}" command="config">
<arg value="-g" />
<arg value="cache-dir" />
<arg value="/srv/var/cache/composer" />
</composer>
<mkdir dir="${project.basedir}/.sync" />
<chmod file="${project.basedir}/.sync" mode="0744" />
<composer composer="${composer.path}" command="install" />
<exec executable="sync-vendor" passthru="true" />
<echo message="${phing.project.name} ComposerInstall - OK" />
</target>
<target name="app-deploy">
<SymfonyConsole console="${symfony.console}" command="cache:clear" checkReturn="true">
<arg name="env" value="${symfony.env}" />
<arg value="--no-warmup" />
</SymfonyConsole>
<SymfonyConsole console="${symfony.console}" command="cache:warmup" checkReturn="true">
<arg name="env" value="${symfony.env}" />
</SymfonyConsole>
<SymfonyConsole console="${symfony.console}" command="assets:install" checkReturn="true">
<arg name="env" value="${symfony.env}" />
<arg value="web" />
</SymfonyConsole>
<echo message="${phing.project.name} AppDeploy - OK" />
</target>
<target name="database-deploy">
<SymfonyConsole console="${symfony.console}" command="doctrine:schema:update" checkReturn="true">
<arg name="env" value="${symfony.env}" />
<arg value="--force" />
<arg value="--no-interaction" />
</SymfonyConsole>
<SymfonyConsole console="${symfony.console}" command="doctrine:migrations:status" checkReturn="true">
<arg name="env" value="${symfony.env}" />
</SymfonyConsole>
<SymfonyConsole console="${symfony.console}" command="doctrine:migrations:migrate" checkReturn="true">
<arg name="env" value="${symfony.env}" />
<arg value="--no-interaction" />
<arg value="--allow-no-migration" />
</SymfonyConsole>
<echo message="${phing.project.name} DatabaseDeploy - OK" />
</target>
<target name="storage-prepare">
<mkdir dir="${project.storage.dir}/upload" />
<chown file="${project.storage.dir}/upload" user="www-data" group="www-data" failonerror="false" />
<mkdir dir="${project.storage.dir}/sessions" />
<chown file="${project.storage.dir}/sessions" user="www-data" group="www-data" failonerror="false" />
</target>
</project>