-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
145 lines (121 loc) · 6.78 KB
/
build.xml
File metadata and controls
145 lines (121 loc) · 6.78 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="amee" default="clean-deploy" basedir=".">
<!-- Properties may be overridden in build.properties -->
<property environment="env"/>
<property file="build.properties"/>
<property name="amee.appName" value="amee"/>
<property name="amee.instanceName" value="local"/>
<property name="amee.home" value="/var/www/apps/${amee.appName}-${amee.instanceName}.amee.com" description="The root of the AMEE deployment layout."/>
<property name="amee.current" value="${amee.home}/current" description="The root of the current AMEE package"/>
<property name="amee.current.lib" value="${amee.current}/lib" description="The location of the AMEE libs and dependencies."/>
<property name="amee.shared" value="${amee.home}/shared" description="The location of the AMEE shared config."/>
<!-- Set your development directory in build.properties -->
<property name="amee.devel.home" value="/Development/AMEE/amee.platform/project/amee" />
<property name="db.name" value="amee"/>
<property name="db.username" value="amee"/>
<property name="db.password" value="amee"/>
<property name="mvn.executable" value="/usr/bin/mvn"/>
<property name="cap.executable" value="/usr/bin/cap"/>
<target name="rebuild" depends="clean, package, copy-amee-libs"
description="Perform a clean build from src."/>
<target name="build" depends="package" description="Perform an incremental build from src."/>
<target name="clean" description="Clean the deployment lib and target directories.">
<!-- Clean the amee target dirs. -->
<exec executable="${mvn.executable}" dir="server" failonerror="true">
<!--arg value="-o"/-->
<arg value="clean"/>
</exec>
<!-- Clean the amee deployment lib dir. -->
<delete>
<fileset dir="${amee.current.lib}" includes="*.jar"/>
</delete>
</target>
<target name="package" description="Run the mvn package goal.">
<exec executable="${mvn.executable}" dir="server" failonerror="true">
<!--arg value="-o"/-->
<arg value="package"/>
</exec>
</target>
<target name="copy-amee-libs" description="Copy libs to deployment dir.">
<copy todir="${amee.current.lib}" flatten="true">
<fileset dir=".">
<include name="**/amee-*.jar"/>
<include name="**/dependency/*.jar"/>
</fileset>
</copy>
</target>
<target name="copy-wrapper" description="Copy the AMEE local wrapper.conf to the deployment folder.">
<copy tofile="${amee.shared}/wrapper.conf" file="server/amee-engine/conf/wrapper.conf.local"
overwrite="true"/>
</target>
<target name="copy-webapps" description="Copy the AMEE webapp to the deployment folder.">
<copy todir="${amee.current}">
<fileset dir=".">
<include name="webapps/"/>
</fileset>
</copy>
</target>
<target name="clean-deploy" depends="rebuild, copy-webapps" description="Rebuild and deploy AMEE."/>
<target name="cap-local-deploy" depends="rebuild" description="Capistrano local deploy from working copy">
<exec executable="cap" dir="${basedir}" failonerror="true">
<arg value="local"/>
<arg value="install:prepare"/>
</exec>
<exec executable="cap" dir="${basedir}" failonerror="true">
<arg value="local"/>
<arg value="install:package"/>
</exec>
<exec executable="cap" dir="${basedir}" failonerror="true">
<arg value="local"/>
<arg value="deploy:update"/>
</exec>
</target>
<target name="cap-install" depends="rebuild" description="Create a new release and deploy to git.">
<fail unless="tag" message="You must specify a tag, eg -Dtag=2.10.5" />
<exec executable="${cap.executable}" dir="${basedir}" failonerror="true">
<env key="PLATFORM_SRC_DIR" value="${amee.devel.home}" />
<env key="PLATFORM_PKG_DIR" value="${amee.package.dir}" />
<arg value="install"/>
<arg value="TAG=${tag}"/>
</exec>
</target>
<target name="init-dir" description="Set up the deployment directory structure.">
<!-- shared -->
<mkdir dir="${amee.shared}" />
<mkdir dir="${amee.shared}/log" />
<mkdir dir="${amee.shared}/pids" />
<mkdir dir="${amee.shared}/system" />
<symlink link="${amee.shared}/crypto" resource="${amee.devel.home}/server/amee-engine/src/test/resources/crypto" overwrite="true" />
<!-- current -->
<mkdir dir="${amee.current.lib}" />
<symlink link="${amee.current}/bin" resource="${amee.devel.home}/server/amee-engine/bin" overwrite="true" />
<symlink link="${amee.current}/conf" resource="${amee.devel.home}/server/amee-engine/conf" overwrite="true" />
<symlink link="${amee.current}/htdocs" resource="${amee.devel.home}/htdocs" overwrite="true" />
<symlink link="${amee.current}/skins" resource="${amee.devel.home}/server/amee-skins" overwrite="true" />
<symlink link="${amee.current}/log" resource="${amee.home}/shared/log" overwrite="true" />
<symlink link="${amee.current.lib}/wrapper" resource="${amee.devel.home}/server/amee-engine/lib/wrapper" overwrite="true" />
<antcall target="copy-wrapper" />
</target>
<target name="update-db" description="Update the database schema to the latest version">
<!-- See: http://www.liquibase.org/manual/contexts -->
<fail unless="db.contexts" message="You must specifiy a database context, eg -Ddb.contexts=live"/>
<exec executable="${mvn.executable}" dir="server" failonerror="true">
<arg value="liquibase:update"/>
<arg value="-Dliquibase.url=jdbc:mysql://localhost/${db.name}"/>
<arg value="-Dliquibase.username=${db.username}"/>
<arg value="-Dliquibase.password=${db.password}"/>
<arg value="-Dliquibase.contexts=${db.contexts}"/>
</exec>
</target>
<target name="update-sql" description="Generate the SQL required to update the database schema to the latest version">
<!-- See: http://www.liquibase.org/manual/contexts -->
<fail unless="db.contexts" message="You must specifiy a database context, eg -Ddb.contexts=live"/>
<exec executable="${mvn.executable}" dir="server" failonerror="true">
<arg value="liquibase:updateSQL"/>
<arg value="-Dliquibase.url=jdbc:mysql://localhost/${db.name}"/>
<arg value="-Dliquibase.username=${db.username}"/>
<arg value="-Dliquibase.password=${db.password}"/>
<arg value="-Dliquibase.contexts=${db.contexts}"/>
</exec>
</target>
</project>