kosssi
Lead dev @cozycloud Love development Like devops And design is so gooood ^^
La fourchette 11/09/15
Simon C.
+
=
<?xml version="1.0" encoding="utf-8"?>
<project name="lafourchette-module" basedir="." default="build">
<import file="/usr/local/lib/phing/lafourchette-common.xml" />
<!--
##################### Variables
-->
<property name="createBuildDir" value="true" />
<!-- Nginx -->
<property name="nginx.server_name.web" value="${domains.module}"/>
<property name="nginx.log_path" value="${project.basedir}/app/logs"/>
<property name="nginx.root_path" value="${project.basedir}/web"/>
<!--
##################### Install
-->
<target name="install" description="Install" depends="check-sudo">
<phingcall target="install:nginx" />
</target>
<!--
##################### Configure
-->
<target name="configure:parameters">
<copy file="${project.basedir}/installer/parameters.ini.erb" tofile="${project.basedir}/app/config/parameters.ini" overwrite="true">
<filterchain>
<!-- Transform erb into dist file -->
<replaceregexp>
<regexp pattern="<%=(\s+)?@?" replace="@@" ignoreCase="true" />
<regexp pattern="(\s+)?%>" replace="@@" ignoreCase="true" />
<regexp pattern="@@(.*)\['(.*)@@" replace="@@\1.\2@@" ignoreCase="true" />
<regexp pattern="@@(.*)'\](.*)@@" replace="@@\1\2@@" ignoreCase="true" />
</replaceregexp>
<!-- Project tokens -->
<replacetokens begintoken="@@" endtoken="@@">
<token key="domains.myfourchette_api" value="${domains.api.myfourchette}" />
<token key="domains.lafourchette_api" value="${domains.api.lafourchette}" />
<token key="domains.lafourchette" value="${domains.lafourchette}" />
<token key="domains.lafourchettesuisse" value="${domains.lafourchettesuisse}" />
<token key="domains.thefork" value="${domains.thefork}" />
<token key="domains.eltenedor" value="${domains.eltenedor}" />
</replacetokens>
</filterchain>
</copy>
</target>
</project>
import de phing-common
création de variable
création d'une tâche
<exec
command="if [ -f '${project.basedir}/composer.lock' ];
then echo 'true';
else echo 'false';
fi;"
outputProperty="useComposer" />
<echo>Use composer ${useComposer}</echo>
<if>
<equals arg1="${useComposer}" arg2="true" />
<then>
<phingcall target="composer:install" />
<if>
<equals arg1="${isSymfony}" arg2="true" />
<then>
<phingcall target="symfony:cache:clear"/>
<phingcall target="symfony:assets:install"/>
<if>
<and>
<isset property="useAssetic" />
<istrue value="${useAssetic}" />
</and>
<then>
<phingcall target="symfony:assetic:dump"/>
</then>
</if>
</then>
</if>
</then>
</if>
(~15 minutes)
Simon C. @kos_si
By kosssi