public
Last active

Symfony Phing build.xml file

  • Download Gist
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Sample Symfony Application" default="build">
 
<resolvepath propertyName="root_path" file="./" />
<resolvepath propertyName="config_path" file="./app/config/" />
<php function="date" returnProperty="build_date">
<param value="c" />
</php>
 
<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,warmup"></target>
<target name="integrate" depends="clean,compile-configuration,compile-vendors,warmup,migrate-db,run-tests"></target>
<target name="clean">
<delete dir="${root_path}/vendor/" />
<delete file="${root_path}/vendor" />
<delete file="${root_path}/app/bootstrap.php.cache" />
</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="composer.phar install" returnProperty="vendors_output" />
</target>
<target name="compile-configuration">
<copy file="${config_path}/parameters.yml.template" tofile="${config_path}/parameters.yml" overwrite="true">
<filterchain>
<replacetokens begintoken="@@" endtoken="@@">
<token key="DB_SETTINGS_HOST" value="${db_settings.host}" />
<token key="DB_SETTINGS_DATABASE" value="${db_settings.database}" />
<token key="DB_SETTINGS_USERNAME" value="${db_settings.username}" />
<token key="DB_SETTINGS_PASSWORD" value="${db_settings.password}" />
<token key="DB_SETTINGS_TEST_HOST" value="${db_settings_test.host}" />
<token key="DB_SETTINGS_TEST_DATABASE" value="${db_settings_test.database}" />
<token key="DB_SETTINGS_TEST_USERNAME" value="${db_settings_test.username}" />
<token key="DB_SETTINGS_TEST_PASSWORD" value="${db_settings_test.password}" />
<token key="BUILD_DATE" value="${build_date}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="warmup">
<exec command="php ${root_path}/app/console assets:install web --no-interaction --no-ansi --symlink --env=prod" />
 
<exec command="php ${root_path}/app/console cache:clear --env=prod --no-interaction --no-ansi" />
<exec command="php ${root_path}/app/console cache:clear --env=test --no-interaction --no-ansi" />
<exec command="php ${root_path}/app/console cache:warmup --env=test --no-interaction --no-ansi" />
<exec command="php ${root_path}/app/console cache:warmup --env=prod --no-interaction --no-ansi" />
</target>
<target name="migrate-db">
<exec command="php app/console doctrine:migrations:migrate --no-interaction --no-ansi" checkreturn="true" />
</target>
 
<target name="run-tests">
<exec command="phpunit -c app" checkreturn="true" />
</target>
</project>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.