|
2 | 2 | <project name="SRS" basedir="." default="main"> |
3 | 3 | <property name="tempDir" value="temp"/> |
4 | 4 | <target name="main" description="Runs tests and prepares deployable tarball"> |
5 | | - <exec command="composer install" passthru="true"/> |
| 5 | + <exec executable="composer" passthru="true"> |
| 6 | + <arg value="install"/> |
| 7 | + </exec> |
| 8 | + |
6 | 9 | <phingcall target="static-analysis"/> |
7 | 10 | <phingcall target="coding-standard"/> |
8 | | - <exec command="php www/index.php orm:validate-schema --skip-sync"/> |
| 11 | + |
| 12 | + <exec executable="php"> |
| 13 | + <arg value="www/index.php"/> |
| 14 | + <arg value="orm:validate-schema"/> |
| 15 | + <arg value="--skip-sync"/> |
| 16 | + </exec> |
| 17 | + |
9 | 18 | <phingcall target="tests"/> |
10 | 19 | </target> |
11 | 20 |
|
12 | 21 | <target name="prepare-tarball" description="Prepares deployable tarball with everything built"> |
13 | | - <exec command="git rev-parse --short HEAD" outputProperty="build.hash"/> |
| 22 | + <exec executable="git" outputProperty="build.hash"> |
| 23 | + <arg value="rev-parse"/> |
| 24 | + <arg value="--short HEAD"/> |
| 25 | + </exec> |
| 26 | + |
14 | 27 | <property name="build.dir" value="${tempDir}/builds/${build.hash}"/> |
15 | 28 |
|
16 | | - <exec command="yarn install" passthru="true"/> |
17 | | - <exec command="yarn build" passthru="true"/> |
| 29 | + <exec executable="yarn" passthru="true"> |
| 30 | + <arg value="install"/> |
| 31 | + </exec> |
| 32 | + <exec executable="yarn" passthru="true"> |
| 33 | + <arg value="build"/> |
| 34 | + </exec> |
18 | 35 |
|
19 | 36 | <delete dir="${build.dir}"/> |
20 | 37 | <mkdir dir="${build.dir}"/> |
|
58 | 75 | </filterchain> |
59 | 76 | </copy> |
60 | 77 |
|
61 | | - <exec command="composer --working-dir=${build.dir} install |
62 | | - --no-interaction |
63 | | - --optimize-autoloader |
64 | | - --classmap-authoritative |
65 | | - --no-dev" |
66 | | - passthru="true"/> |
| 78 | + <exec executable="composer" passthru="true"> |
| 79 | + <arg value="--working-dir=${build.dir}"/> |
| 80 | + <arg value="install"/> |
| 81 | + <arg value="--no-interaction"/> |
| 82 | + <arg value="--optimize-autoloader"/> |
| 83 | + <arg value="--classmap-authoritative"/> |
| 84 | + <arg value="--no-dev"/> |
| 85 | + </exec> |
67 | 86 |
|
68 | 87 | <delete> |
69 | 88 | <fileset dir="${build.dir}"> |
|
91 | 110 | <target name="deploy:ssh"> |
92 | 111 | <echo message="${comment}..."/> |
93 | 112 | <echo message="${command}"/> |
94 | | - <exec command="ssh ${deploy.ssh.target} -p ${deploy.ssh.port} '${command}'" passthru="true" checkreturn="true"/> |
| 113 | + <exec executable="ssh" passthru="true" checkreturn="true"> |
| 114 | + <arg value="${deploy.ssh.target}"/> |
| 115 | + <arg value="-p ${deploy.ssh.port}"/> |
| 116 | + <arg value="'${command}'"/> |
| 117 | + </exec> |
95 | 118 | </target> |
96 | 119 |
|
97 | 120 | <target name="deploy:copy-tarball"> |
98 | | - <property name="command" value="scp -P ${port} ${file} '${target}:${toDirectory}'"/> |
| 121 | + <property name="command" value="scp"/> |
| 122 | + <property name="args" value="-P ${port} ${file} '${target}:${toDirectory}'"/> |
99 | 123 | <echo message="Copying files to ${deploy.ssh.target}"/> |
100 | | - <echo message="${command}"/> |
101 | | - <exec command="${command}" passthru="true" checkreturn="true"/> |
| 124 | + <echo message="${command} ${args}"/> |
| 125 | + <exec executable="${command}" passthru="true" checkreturn="true"> |
| 126 | + <arg value="${args}"/> |
| 127 | + </exec> |
102 | 128 | </target> |
103 | 129 |
|
104 | 130 | <target name="deploy:cleanup"> |
|
121 | 147 | <property environment="env"/> |
122 | 148 | <property name="deploy.workDir" refid="env.DEPLOY_DIRECTORY"/> |
123 | 149 | <property name="deploy.releasesDir" value="${deploy.workDir}/releases"/> |
124 | | - <exec command="git rev-parse --short HEAD" outputProperty="build.hash"/> |
| 150 | + <exec executable="git" outputProperty="build.hash"> |
| 151 | + <arg value="rev-parse"/> |
| 152 | + <arg value="--short HEAD"/> |
| 153 | + </exec> |
125 | 154 | <property name="deploy.lebeda" refid="env.DEPLOY_LEBEDA"/> |
126 | 155 | <property name="deploy.ssh.host" refid="env.DEPLOY_SSH_HOST"/> |
127 | 156 | <property name="deploy.ssh.username" refid="env.DEPLOY_SSH_USERNAME"/> |
|
244 | 273 | </target> |
245 | 274 |
|
246 | 275 | <target name="tests-unit"> |
247 | | - <exec command="vendor/bin/codecept run unit" passthru="true" checkreturn="true"/> |
| 276 | + <exec executable="vendor/bin/codecept" passthru="true" checkreturn="true"> |
| 277 | + <arg value="run"/> |
| 278 | + <arg value="unit"/> |
| 279 | + </exec> |
248 | 280 | </target> |
249 | 281 |
|
250 | 282 | <target name="tests-integration"> |
251 | | - <exec command="vendor/bin/codecept run integration" passthru="true" checkreturn="true"/> |
| 283 | + <exec executable="vendor/bin/codecept" passthru="true" checkreturn="true"> |
| 284 | + <arg value="run"/> |
| 285 | + <arg value="integration"/> |
| 286 | + </exec> |
252 | 287 | </target> |
253 | 288 |
|
254 | 289 | <target name="tests-performance"> |
255 | | - <exec command="vendor/bin/codecept run performance" passthru="true" checkreturn="true"/> |
| 290 | + <exec executable="vendor/bin/codecept" passthru="true" checkreturn="true"> |
| 291 | + <arg value="run"/> |
| 292 | + <arg value="performance"/> |
| 293 | + </exec> |
256 | 294 | </target> |
257 | 295 |
|
258 | 296 | <target name="tests"> |
|
261 | 299 | </target> |
262 | 300 |
|
263 | 301 | <target name="tests-with-coverage"> |
264 | | - <exec command="php -d zend_extension=xdebug.so -d xdebug.mode=coverage vendor/bin/codecept run unit,integration --coverage-xml" |
265 | | - passthru="true" checkreturn="true"/> |
| 302 | + <exec executable="php" passthru="true" checkreturn="true"> |
| 303 | + <arg value="-d zend_extension=xdebug.so"/> |
| 304 | + <arg value="-d xdebug.mode=coverage"/> |
| 305 | + <arg value="vendor/bin/codecept"/> |
| 306 | + <arg value="run"/> |
| 307 | + <arg value="unit,integration"/> |
| 308 | + <arg value="--coverage-xml"/> |
| 309 | + </exec> |
266 | 310 | </target> |
267 | 311 |
|
268 | 312 | <target name="static-analysis"> |
269 | | - <exec command="php -d memory_limit=1024M vendor/bin/phpstan analyse -l 6 -c phpstan.neon app --no-progress" |
270 | | - passthru="true" checkreturn="true"/> |
| 313 | + <exec executable="php" passthru="true" checkreturn="true"> |
| 314 | + <arg value="-d memory_limit=1024M"/> |
| 315 | + <arg value="vendor/bin/phpstan"/> |
| 316 | + <arg value="analyse"/> |
| 317 | + <arg value="-l6"/> |
| 318 | + <arg value="-cphpstan.neon"/> |
| 319 | + <arg value="app"/> |
| 320 | + <arg value="--no-progress"/> |
| 321 | + </exec> |
271 | 322 | </target> |
272 | 323 |
|
273 | 324 | <target name="coding-standard"> |
274 | | - <exec command="vendor/bin/phpcs" passthru="true" checkreturn="true"/> |
| 325 | + <exec executable="vendor/bin/phpcs" passthru="true" checkreturn="true"/> |
275 | 326 | </target> |
276 | 327 | </project> |
0 commit comments