forked from Arcavias/arcavias-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
162 lines (134 loc) · 6.62 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Arcavias demo application" default="install">
<property name="coredir" value="${project.basedir}/vendor/arcavias/arcavias-core" override="true" />
<property name="extdir" value="${project.basedir}/ext" override="true" />
<target name="resource" description="Creates the resource configuration">
<echo msg="Creating resource configuration" />
<input propertyName="dbadapter" promptChar=" :" defaultValue="mysql" >Database type</input>
<input propertyName="dbhost" promptChar=" :" defaultValue="localhost" >Server host</input>
<input propertyName="dbport" promptChar=" :" defaultValue="3306" >Server port</input>
<input propertyName="dbname" promptChar=":" defaultValue="arcavias" >Database name</input>
<input propertyName="dbuser" promptChar=" :" defaultValue="root" >User name</input>
<input propertyName="dbpass" promptChar=" :" defaultValue="" >Password</input>
<echo file="${project.basedir}/config/resource.php"><?php
return array(
'db' => array(
'adapter' => '${dbadapter}',
'host' => '${dbhost}',
'port' => '${dbport}',
'database' => '${dbname}',
'username' => '${dbuser}',
'password' => '${dbpass}',
'limit' => 2,
'opt-persistent' => false,
'stmt' => array(
"SET NAMES 'utf8'",
"SET SESSION sql_mode='ANSI'"
)
)
);</echo>
</target>
<target name="classes" description="Creates the classes configuration">
<echo msg="Creating configuration for used components" />
<input propertyName="cache" promptChar=" :" defaultValue="Default" >Cache class name ("None" disables caching)</input>
<echo file="${project.basedir}/config/classes.php"><?php
return array(
'cache' => array(
'manager' => array(
'name' => '${cache}',
),
),
);</echo>
</target>
<target name="email" description="Creates the e-mail configuration">
<echo msg="Creating e-mail configuration" />
<input propertyname="mailfrom" promptChar=" :" defaultValue="" >Sender e-mail</input>
<input propertyname="mailhost" promptChar=" :" defaultValue="localhost" >SMTP host</input>
<input propertyname="mailport" promptChar=" :" defaultValue="25" >SMTP port</input>
<input propertyname="mailuser" promptChar=" :" >User name</input>
<input propertyname="mailpass" promptChar=" :" >Password</input>
<input propertyname="mailssl" promptChar=":" defaultValue="" validArgs=",ssl,tls" >Security </input>
<input propertyname="mailauth" promptChar=":" defaultValue="" validArgs=",plain,login,crammd5 ">Auth type </input>
<echo file="${project.basedir}/config/client.php"><?php
return array(
'html' => array(
'email' => array(
'from-email' => '${mailfrom}',
'server' => array(
'host' => '${mailhost}',
'port' => '${mailport}',
'ssl' => '${mailssl}',
'auth' => '${mailauth}',
'username' => '${mailuser}',
'password' => '${mailpass}',
)
)
)
);</echo>
</target>
<target name="code" description="Updates the demo code base">
<echo msg="Updating the demo code base" />
<exec command="git pull https://github.com/Arcavias/arcavias-demo.git" checkreturn="true" logoutput="true" />
<exec command="composer update --working-dir ${project.basedir}" checkreturn="true" logoutput="true" />
</target>
<target name="composer" description="Installs the required packages via composer">
<echo msg="Installing required packages via composer" />
<exec command="composer install --working-dir ${project.basedir}" checkreturn="true" logoutput="true" />
</target>
<target name="permission" description="Sets the necessary permissions">
<mkdir dir="${project.basedir}/images/files"/>
<mkdir dir="${project.basedir}/images/preview"/>
<chmod mode="0777" failonerror="false" >
<fileset dir="${project.basedir}/images/files" />
<fileset dir="${project.basedir}/images/preview" />
</chmod>
</target>
<target name="setup" description="Sets up database incl. demo and performance data">
<echo msg="Setting up demo database" />
<exec command="php ${coredir}/setup.php --config=${project.basedir}/config --extdir=${project.basedir}/ext --option=setup/default/demo:1" checkreturn="true" logoutput="true"/>
<input propertyname="perfdata" promptChar=":" defaultValue="Yes" validArgs="YES,no" >Add performance data (takes several minutes) </input>
<if>
<equals arg1="${perfdata}" arg2="YES" />
<then>
<echo msg="Setting up performance data" />
<exec command="php ${coredir}/setup.php --config=${project.basedir}/config --extdir=${project.basedir}/ext unitperf" checkreturn="true" logoutput="true"/>
</then>
</if>
</target>
<target name="test" description="Executes all tests">
<echo msg="Executing tests" />
<if>
<not><available file="${project.basedir}/tests/config/tests.php" type="file" property="testconfig" /></not>
<then>
<input propertyname="destaddr" promptChar=":" >Destination e-mail address</input>
<echo file="${project.basedir}/tests/config/tests.php"><?php
return array(
'email' => array(
'destaddr' => '${destaddr}',
)
);</echo>
</then>
</if>
<exec command="phpunit -d memory_limit=-1 --include-path ${project.basedir}/zendlib --configuration=phpunit.xml"
dir="${project.basedir}/tests" checkreturn="true" logoutput="true" />
</target>
<target name="release" description="Creates new release">
<propertyprompt propertyName="version" promptText="Enter release version" promptCharacter=":" useExistingValue="true"/>
<exec command="git branch ${version}" checkreturn="true" logoutput="true" />
<exec command="git tag -a ${version}.0 -m 'Release ${version}.0'" checkreturn="true" logoutput="true" />
<exec command="git push origin ${version}" checkreturn="true" logoutput="true" />
<exec command="git push --tags" checkreturn="true" logoutput="true" />
</target>
<target name="deploy" description="Creates a download package" depends="composer">
<propertyprompt propertyName="version" promptText="Enter release version" promptCharacter=":" useExistingValue="true"/>
<exec command="tar -c --bzip2 --exclude-from=.exclude -f ../arcavias-demo_${version}.tar.bz2 ."
checkreturn="true" logoutput="true"/>
<filehash file="../arcavias-demo_${version}.tar.bz2" hashtype="1" />
<echo msg="SHA1 hash value: ${filehashvalue}" />
</target>
<target name="createext" description="Creates new extension">
<phing target="createext" dir="${coredir}" />
</target>
<target name="install" depends="resource,email,classes,composer,permission,setup" description="Installs the Arcavias demo application with unit test data" />
<target name="update" depends="code,setup" description="Updatess the Arcavias demo application including the unit test data" />
</project>