-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
98 lines (80 loc) · 4.22 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
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="/usr/share/php/data/phing/etc/phing-grammar.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0" ?>
<!--
- This file is part of the nDeploy package.
-
- (c) Peter Buri <[email protected]>
-
- For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
-->
<project name="build" default="start">
<!-- include build.properties -->
<property name="ndeploy.propertiesfile" value="./build.properties" override="false" />
<property file="${ndeploy.propertiesfile}" />
<!-- run command -->
<property name="ndeploy.start.command" value="init" override="false" />
<!-- deploying user -->
<property name="ndeploy.user" value="" override="false" />
<!-- import all the targets -->
<property name="ndeploy.basedir" value="${phing.dir}" override="false" />
<import file="${ndeploy.basedir}/target/ndeploy.base.xml"/>
<!-- application config -->
<property name="basedir" value="${user.home}" override="false" />
<property name="application.name" value="" override="false" />
<property name="application.framework" value="" override="false" />
<property name="application.deploydir" value="${basedir}/current" override="false" />
<property name="application.releasesdir" value="${basedir}/releases" override="false" />
<property name="application.releasesdir.latest" value="${application.releasesdir}/latest" override="false" />
<property name="application.repositorydir" value="${basedir}/src/${application.name}" override="false" />
<property name="application.releaseskept" value="100" override="false" />
<!-- application tasks run order -->
<property name="application.run.pre" value="ndeploy.base.application.pre,ndeploy.scm.init,ndeploy.base.release.clean" override="false" />
<property name="application.run.init" value="ndeploy.base.shared,ndeploy.maintenance.init" override="false" />
<property name="application.run.release" value="ndeploy.base.release" override="false" />
<property name="application.run.after" value="ndeploy.vendor.init,ndeploy.framework.init,ndeploy.base.application,ndeploy.maintenance.remove,ndeploy.base.application.post" override="false" />
<!-- timestamp format -->
<tstamp>
<format property="application.deployhash" pattern="%Y%m%d_%H%M%S" />
</tstamp>
<!-- scm config -->
<property name="scm.type" value="git" override="false" />
<property name="scm.ref" value="origin/master" override="false" />
<property name="scm.repository" value="" override="false" />
<!-- shared config -->
<property name="shared.basedir" value="${basedir}/shared" override="false" />
<property name="shared.files" value="" />
<target name="start">
<if>
<not><equals arg1="${ndeploy.user}" arg2="" /></not>
<then>
<exec command="whoami" outputProperty="running-user" checkreturn="true" />
<if>
<not><equals arg1="${running-user}" arg2="${ndeploy.user}" /></not>
<then>
<echo level="error" msg="Deploy must be run as '${ndeploy.user}'. You tried to deploy as '${running-user}'." />
<fail>Deploy must be run as '${ndeploy.user}'. You tried to deploy as '${running-user}'.</fail>
</then>
</if>
</then>
</if>
<phingcall target="${ndeploy.start.command}" />
</target>
<target name="init">
<!-- start -->
<tstamp>
<format property="ndeploy.timestamp.start" pattern="%Y-%m-%d %H:%M:%S" />
</tstamp>
<echo message="Deploy started at ${ndeploy.timestamp.start}" level="warning" />
<!-- init -->
<phingcall target="ndeploy.base.init" />
<!-- end -->
<tstamp>
<format property="ndeploy.timestamp.end" pattern="%Y-%m-%d %H:%M:%S" />
</tstamp>
<echo message="Deploy ended at ${ndeploy.timestamp.end} (start: ${ndeploy.timestamp.start})" level="warning" />
</target>
<target name="config">
<phingcall target="ndeploy.base.config" />
</target>
</project>