-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
164 lines (137 loc) · 927 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?xml version="1.0" encoding="UTF-8"?>
<project name="4success" default="build">
<import file="build-epam-ci.xml"/>
<!-- Targets -->
<!-- You can customize build, build-ci, package targets by overriding them here. Also you can override any other target -->
<!--<target name="build" description="Builds the project. Intended for usage on the command line before committing."-->
<!--depends="clean,prepare,composer-validate,phplint,php-cs-fixer,symfony-assets-install-dev,symfony-assetic-dump-dev,symfony-doctrine-schema-validate,symfony-doctrine-fixtures-load,symfony-twig-lint,phpmd,phpcs,phpcs-js,phpcpd,phpunit,hphpa,dependencies-list-updates,sensiolabs-security-checker"/>-->
<!--<target name="build-ci" description="Builds the project for the continuous integration server"-->
<!--depends="clean,prepare,composer-validate,copy-configs-ci,dependencies-install,check-environment,phplint,symfony-doctrine-database-recreate,symfony-doctrine-schema-validate,symfony-doctrine-fixtures-load,symfony-twig-lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcs-js-ci,phpcpd-ci,apidoc,phpunit,phpcb,hphpa-ci,dependencies-list-updates,sensiolabs-security-checker"/>-->
<!--<target name="package" description="Prepares archived package containing ready for deployment application"-->
<!--depends="prepare,composer-validate,copy-configs-ci,dependencies-install,symfony-doctrine-schema-dump,symfony-cache-warmup-prod,symfony-assets-install-prod,symfony-assetic-dump-prod,package-db-schema,package-version,package-archive"/>-->
<!-- temp removed phpcs-ci,phpcs-js-ci, dependencies-list-updates,-->
<!-- Override Epam Targets -->
<target name="build-ci" description="Builds the project for the continuous integration server"
depends="clean,prepare,composer-validate,copy-configs-ci,dependencies-install,schema-update-local,symfony-doctrine-fixtures-load,check-environment,apc-clear,phpunit,phpunit-coverage,behat,phpcs-ci,phplint,symfony-twig-lint,phploc,pdepend,phpcpd-ci,apidoc,phpmd-ci,phpcb,phpcs-ci,sensiolabs-security-checker"/>
<!--
<target name="build-ci" description="Builds the project for the continuous integration server"
depends="phpunit,phpunit-coverage,behat,phpcs-ci,phpmd-ci,phpcb,apidoc,pdepend"/>
-->
<target name="dependencies-install" description="Install dependencies via Composer">
<!--<delete dir="${project.dir-bin}"/>-->
<!--<delete dir="${project.dir-vendors}"/>-->
<composer composer="${project.bin-composer}" command="install">
<arg value="--optimize-autoloader"/>
</composer>
</target>
<target name="phpunit" description="Run only unit tests with PHPUnit">
<!-- Read http://symfony.com/doc/current/book/testing.html for details -->
<exec command="phpunit -c ${project.dir-app-resources-configs-phpunit}" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="copy-configs-ci" description="Copy configs for CI server">
<copy file="${project.file-config-parameters-ci}" tofile="${project.dir-app}/config/parameters.yml"
overwrite="true" haltonerror="true"/>
</target>
<target name="phpcs-ci"
description="Find coding standard violations in PHP source using PHP_CodeSniffer creating a log file for the continuous integration server">
<phpcodesniffer standard="${project.phpcs-php-standard}" encoding="UTF-8" haltonerror="false">
<fileset refid="src-php"/>
<formatter type="xml" outfile="${project.dir-build-logs}/phpcs.xml"/>
<formatter type="checkstyle" outfile="${project.dir-build-logs}/checkstyle-phpcs.xml"/>
</phpcodesniffer>
</target>
<fileset dir="${project.basedir}" id="symfony-temp">
<!--<include name="${project.dir-app-cache}/**"/>
<exclude name="${project.dir-app-cache}/.gitkeep"/>-->
<include name="${project.dir-app-logs}/*"/>
<exclude name="${project.dir-app-logs}/.gitkeep"/>
</fileset>
<!-- Own Targets -->
<target name="build-ci-minimal" description="Builds the project for the continuous integration server"
depends="clean,prepare,composer-validate,copy-configs-ci,dependencies-install,check-environment,symfony-doctrine-schema-recreate,symfony-doctrine-fixtures-load-test,apc-clear,symfony-twig-lint,phpunit,behat"/>
<target name="deploy" description="Deploy to production server"
depends="deploy-maintenance-enable,cap-production-deploy,symfony-cache-clear-prod,symfony-cache-warmup-prod,deploy-maintenance-disable"/>
<target name="behat" description="Run behat test">
<exec command="${project.dir-bin}/behat --config behat.yml.dist --profile jenkins" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="behat-advanced" description="Run behat test with advaned filter">
<exec command="${project.dir-bin}/behat --config behat.yml.dist --profile jenkins-advanced" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="cap-production-deploy" description="Run capifony production deploy">
<exec command="cap production deploy" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="cap-beta-deploy" description="Run capifony beta deploy">
<exec command="cap beta deploy" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="schema-update" description="Run capifony force schema update">
<exec command="cap production symfony:doctrine:schema:update" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="schema-update-local" description="Run capifony force schema update">
<exec command="app/console doctrine:schema:update --force" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="phpunit-coverage" description="Run unit tests code coverage analize with PHPUnit">
<!-- Read http://symfony.com/doc/current/book/testing.html for details -->
<exec command="phpunit -c ${project.dir-app-resources-configs-phpunit-coverage}" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="symfony-twig-lint"
description="Lints a template and outputs encountered errors for all templates">
<SymfonyConsole command="twig:lint" checkreturn="true">
<arg value="${project.dir-src}"/>
<arg name="no-interaction"/>
</SymfonyConsole>
</target>
<target name="apc-clear"
description="Clear APC cache">
<SymfonyConsole command="cache:accelerator:clear --env=dev" checkreturn="true">
</SymfonyConsole>
</target>
<!--
<target name="cache-clear"
description="Clear Symfony cache">
<SymfonyConsole command="cache:clear " checkreturn="true">
</SymfonyConsole>
</target>
<target name="cache-warmup"
description="Warmup Symfony cache">
<SymfonyConsole command="cache:warmup " checkreturn="true">
</SymfonyConsole>
</target>
-->
<target name="symfony-cache-clear-prod" description="Clear cache for prod environment">
<SymfonyConsole command="cache:clear" checkreturn="true">
<arg name="env" value="prod"/>
<arg name="no-debug"/>
<arg name="no-interaction"/>
</SymfonyConsole>
</target>
<target name="chown-cache" description="Make jenkins owner of cache to cleanup">
<!-- Read http://symfony.com/doc/current/book/testing.html for details -->
<exec command="chown -R jenkins ${project.dir-app-cache}" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="master-merge" description="Merge develop branches to master"
depends="make-project-master"/>
<target name="make-project-master" description="Merge project develop branche to master">
<exec command="git checkout master;git pull --rebase origin master;git pull --rebase origin develop;git push origin master" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="make-core-master" description="Merge core develop branche to master">
<exec command="cd ${project.dir-src};git checkout master;git pull --rebase origin master;git merge develop;git push origin master" passthru="true" checkreturn="true" logoutput="true"/>
</target>
<target name="symfony-doctrine-fixtures-load-test"
description="Loads Doctrine data fixtures to the database">
<SymfonyConsole command="doctrine:fixtures:load" checkreturn="true">
<arg name="no-interaction"/>
<arg name="env" value="dev"/>
</SymfonyConsole>
</target>
<target name="symfony-doctrine-schema-recreate" description="Drops and creates database schema">
<SymfonyConsole command="doctrine:schema:drop" checkreturn="true">
<arg name="no-interaction"/>
<arg name="force"/>
<arg name="env" value="dev"/>
</SymfonyConsole>
<SymfonyConsole command="doctrine:schema:create" checkreturn="true">
<arg name="no-interaction"/>
<arg name="env" value="dev"/>
</SymfonyConsole>
</target>
</project>