-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.xml
78 lines (67 loc) · 3.46 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
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<project name="Expert PHP Deployments" default="build">
<resolvepath propertyName="root_path" file="./" />
<php function="date" returnProperty="build_date">
<param value="c" />
</php>
<php function="time" returnProperty="build_timestamp" />
<available file="${build_settings_file}" property="build_settings_file_exists" value="1" />
<if>
<equals arg1="${build_settings_file_exists}" arg2="1" />
<then>
<property file="${build_settings_file}" />
</then>
</if>
<target name="build" depends="clean,compile-configuration,compile-vendors,run-database-migrations"></target>
<target name="deploy" depends="compile-configuration,compile-vendors,compile-composer-cache"></target>
<target name="clean">
<delete dir="${root_path}/vendor/" quiet="true" />
<delete file="${root_path}/app/config/config-app.php" quiet="true" />
<delete file="${root_path}/app/config/config-postgres.php" quiet="true" />
<delete file="${root_path}/app/config/config-redis.php" quiet="true" />
</target>
<target name="compile-vendors">
<available file="${vendor_path}" property="vendor_path_exists" value="1" />
<if>
<equals arg1="${vendor_path_exists}" arg2="1" />
<then>
<symlink target="${vendor_path}" link="${root_path}/vendor" />
</then>
</if>
<exec command="php composer.phar install --optimize-autoloader --no-ansi" checkreturn="true" passthru="true" />
</target>
<target name="compile-composer-cache">
<exec command="php composer.phar dump-autoload --optimize --no-ansi" checkreturn="true" passthru="true" />
</target>
<target name="compile-configuration">
<copy file="${root_path}/app/config/config-app.php.template" tofile="${root_path}/app/config/config-app.php" overwrite="true">
<filterchain>
<replacetokens begintoken="@@" endtoken="@@">
<token key="BUILD_DATE" value="${build_date}" />
<token key="BUILD_TIMESTAMP" value="${build_timestamp}" />
</replacetokens>
</filterchain>
</copy>
<copy file="${root_path}/app/config/config-postgres.php.template" tofile="${root_path}/app/config/config-postgres.php" overwrite="true">
<filterchain>
<replacetokens begintoken="@@" endtoken="@@">
<token key="DB_HOST" value="${db_host}" />
<token key="DB_NAME" value="${db_name}" />
<token key="DB_USERNAME" value="${db_username}" />
<token key="DB_PASSWORD" value="${db_password}" />
</replacetokens>
</filterchain>
</copy>
<copy file="${root_path}/app/config/config-redis.php.template" tofile="${root_path}/app/config/config-redis.php" overwrite="true">
<filterchain>
<replacetokens begintoken="@@" endtoken="@@">
<token key="REDIS_HOST" value="${redis_host}" />
<token key="REDIS_PORT" value="${redis_port}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="run-database-migrations">
<exec command="php doctrine-migrations.phar migrations:migrate --db-configuration=app/config/config-postgres.php --configuration=app/config/migrations.yml --no-interaction" />
</target>
</project>