-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.helpers.xml
More file actions
128 lines (112 loc) · 4.74 KB
/
Copy pathbuild.helpers.xml
File metadata and controls
128 lines (112 loc) · 4.74 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="UTF-8"?>
<project name="helpers" default="help">
<!-- Required properties -->
<property name="symfony.env" value="prod" />
<!-- Targets that assign properties -->
<target name="symfony.stage.properties" >
<property name="symfony.env" value="stage" override="true" />
</target>
<!-- postcache -->
<target name="postcache"
depends="refresh_vendors_direct"
description="postcache deploy hook" />
<!-- postdeploy targets -->
<target name="post_deploy"
depends="migrate,
assetic_dump,
clear_cache,
restart_memcached"
description="Execute post deployment utilities on production" />
<target name="post_deploy.staging"
depends="staging.properties,
symfony.stage.properties,
post_deploy"
description="Execute post deployment utilities on staging" />
<!-- refresh vendors distributed -->
<target name="refresh_vendors_distributed"
description="Refreshes the vendors" >
<exec dir="${project.basedir}/${build.target}/cached-copy"
passthru="true"
command="bin/vendors install" />
</target>
<!-- suppliment config distributed-->
<target name="suppliment_config_distributed" >
<exec dir="${project.basedir}/${build.target}/cached-copy/app/config"
passthru="true"
command="cp database_dev.yml.dist database_dev.yml" />
</target>
<!-- refresh vendors direct -->
<target name="refresh_vendors_direct"
description="Refreshes the vendors" >
<property name="command"
value="(
cd ${deploy.path}/${build.target}/cached-copy &&
bin/vendors install
)"
override="true" />
<foreach list="${deploy.servers}"
param="deploy.server"
target="deploy.remotecmd" />
</target>
<!-- doctrine:migrations:migrate -->
<target name="migrate"
description="Run migrations on production servers" >
<property name="command"
value="(
cd ${deploy.path}/current/app &&
./console --env=${symfony.env} --no-interaction doctrine:migrations:migrate
)"
override="true" />
<foreach list="${deploy.servers}"
param="deploy.server"
target="deploy.remotecmd" />
</target>
<!-- assets:install -->
<!-- assetic:dump -->
<target name="assetic_dump"
description="Warm assets on production servers" >
<property name="command"
value="(
cd ${deploy.path}/current/app &&
./console --no-ansi --env=${symfony.env} --symlink assets:install ../web &&
./console --no-ansi --env=${symfony.env} assetic:dump
)"
override="true" />
<foreach list="${deploy.servers}"
param="deploy.server"
target="deploy.remotecmd" />
</target>
<!-- cache:clear -->
<!-- cache:warmup -->
<!-- fix cache permissions assumes that the webserver is in the same group as the owner -->
<target name="clear_cache"
description="dump and warm cache on production servers" >
<property name="command"
value="(
cd ${deploy.path}/current/app &&
./console cache:clear --env=${symfony.env} --no-warmup &&
./console cache:warmup --env=${symfony.env} --no-ansi &&
chmod -R 770 cache/
)"
override="true" />
<foreach list="${deploy.servers}"
param="deploy.server"
target="deploy.remotecmd" />
</target>
<!-- restart memcached -->
<target name="restart_memcached"
depends="deploy.memcachedump"
description="Restarts the memcached on production" />
<target name="restart_memcached.staging"
depends="staging.properties, deploy.memcachedump"
description="Restarts the memcached on staging" />
<!-- modification so test can be run -->
<target name="test"
description="Runs application unit tests">
<php expression="$_SERVER['KERNEL_DIR'] = '${project.basedir}/app'" />
<phingcall target="test.do" />
</target>
<!-- target shortcuts -->
<target name="staging" depends="deploy.staging" />
<target name="production" depends="deploy.production" />
</project>