This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
139 lines (121 loc) · 5.68 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
<project name="OLCS Selfserve/SSWEB" default="build">
<property name="version-file" value="config/version"/>
<property name="tar-file" value="olcs-selfserve"/>
<target name="init-environment">
<exec executable="hostname" outputproperty="computer.hostname"/>
<condition property="environment.isSkyScape">
<contains string="${computer.hostname}" substring=".mtpdvsa" casesensitive="false"/>
</condition>
<condition property="environment.isAws">
<contains string="${computer.hostname}" substring=".aws" casesensitive="false"/>
</condition>
<condition property="environment.isOther">
<and>
<not>
<contains string="${computer.hostname}" substring=".mtpdvsa" casesensitive="false"/>
</not>
<not>
<contains string="${computer.hostname}" substring=".aws" casesensitive="false"/>
</not>
</and>
</condition>
</target>
<target name="init-composer-aws" if="environment.isAws">
<exec executable="s3cmd" dir="." failonerror="true">
<arg line="get s3://rpm-repo001/composer.phar --skip-existing"/>
</exec>
<exec executable="sed" dir="." failonerror="true">
<arg line="-i -e 's/satis.inf.mgt.mtpdvsa/devrepo.shd.ci.nonprod.dvsa.aws/g' composer.json"/>
</exec>
<exec executable="sed" dir=".">
<arg line="-i -e 's/satis.inf.mgt.mtpdvsa/devrepo.shd.ci.nonprod.dvsa.aws/g' composer.lock"/>
</exec>
<exec executable="sed" dir="." failonerror="true">
<arg line="-i -e 's/gitlab.inf.mgt.mtpdvsa/repo.shd.ci.nonprod.dvsa.aws/g' composer.json"/>
</exec>
<exec executable="sed" dir=".">
<arg line="-i -e 's/gitlab.inf.mgt.mtpdvsa/repo.shd.ci.nonprod.dvsa.aws/g' composer.lock"/>
</exec>
</target>
<target name="init-composer-skyscape" if="environment.isSkyScape">
<get src="http://satis.inf.mgt.mtpdvsa/composer.phar" dest="composer.phar"/>
</target>
<target name="init-composer-other" if="environment.isOther">
<get src="http://getcomposer.org/composer.phar" dest="composer.phar"/>
</target>
<target name="init-composer" depends="init-environment, init-composer-aws, init-composer-other, init-composer-skyscape">
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir=".">
<include name="**/*.php"/>
<exclude name="vendor/**"/>
</fileset>
</apply>
</target>
<target name="clean" description="Clean (remove) temporary files">
<delete file="data/autoload/classmap.php"/>
<delete>
<fileset dir="data/cache" includes="**"/>
</delete>
</target>
<target name="unittest" description="Run unit tests">
<exec executable="vendor/bin/phpunit" dir="." failonerror="true">
<arg line="-ctest/phpunit.xml"/>
</exec>
</target>
<target name="composer-update" depends="init-composer" description="Update composer dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>
<target name="composer-update-olcs" depends="init-composer" description="Update composer OLCS dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="olcs/*"/>
</exec>
</target>
<target name="composer-install" depends="init-composer" description="Install composer dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="install"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>
<target name="composer-install-nodev" depends="init-composer" description="Install composer dependencies exclude dev dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="install"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-dev"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>
<target name="build" description="Build for production" depends="clean, lint, composer-install, unittest, composer-install-nodev, write-info" />
<target name="tar" description="Create tar.gz file" depends="build">
<exec executable="tar" failonerror="true">
<arg value="-czf${tar-file}.tar.gz"/>
<arg value="--exclude=config/autoload/local.php"/>
<arg value="--exclude=config/autoload/local.php.dist"/>
<arg line="composer.lock init_autoloader.php config module public data/autoload data/cache vendor"/>
</exec>
</target>
<target name="write-info" description="Write build info to a file" if="version-file">
<exec executable="git" output="${version-file}" failonerror="true">
<arg line="describe --all"/>
</exec>
<exec executable="date" output="${version-file}" append="true" failonerror="true"/>
</target>
</project>